Skip to content

Commit 4600ea9

Browse files
pinchartltomba
authored andcommitted
drm: omapdrm: dsi: Store the struct device pointer in struct dsi_data
The dsi_data structure stores a pointer to a struct platform_device. The driver only uses the dev member of the platform device structure. Store the struct device pointer instead and use it directly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
1 parent c7963f5 commit 4600ea9

File tree

1 file changed

+13
-13
lines changed
  • drivers/gpu/drm/omapdrm/dss

1 file changed

+13
-13
lines changed

drivers/gpu/drm/omapdrm/dss/dsi.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ struct dsi_of_data {
330330
};
331331

332332
struct dsi_data {
333-
struct platform_device *pdev;
333+
struct device *dev;
334334
void __iomem *proto_base;
335335
void __iomem *phy_base;
336336
void __iomem *pll_base;
@@ -1144,7 +1144,7 @@ static int dsi_runtime_get(struct dsi_data *dsi)
11441144

11451145
DSSDBG("dsi_runtime_get\n");
11461146

1147-
r = pm_runtime_get_sync(&dsi->pdev->dev);
1147+
r = pm_runtime_get_sync(dsi->dev);
11481148
WARN_ON(r < 0);
11491149
return r < 0 ? r : 0;
11501150
}
@@ -1155,7 +1155,7 @@ static void dsi_runtime_put(struct dsi_data *dsi)
11551155

11561156
DSSDBG("dsi_runtime_put\n");
11571157

1158-
r = pm_runtime_put_sync(&dsi->pdev->dev);
1158+
r = pm_runtime_put_sync(dsi->dev);
11591159
WARN_ON(r < 0 && r != -ENOSYS);
11601160
}
11611161

@@ -1166,7 +1166,7 @@ static int dsi_regulator_init(struct dsi_data *dsi)
11661166
if (dsi->vdds_dsi_reg != NULL)
11671167
return 0;
11681168

1169-
vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdd");
1169+
vdds_dsi = devm_regulator_get(dsi->dev, "vdd");
11701170

11711171
if (IS_ERR(vdds_dsi)) {
11721172
if (PTR_ERR(vdds_dsi) != -EPROBE_DEFER)
@@ -4951,7 +4951,7 @@ static int dsi_get_clocks(struct dsi_data *dsi)
49514951
{
49524952
struct clk *clk;
49534953

4954-
clk = devm_clk_get(&dsi->pdev->dev, "fck");
4954+
clk = devm_clk_get(dsi->dev, "fck");
49554955
if (IS_ERR(clk)) {
49564956
DSSERR("can't get fck\n");
49574957
return PTR_ERR(clk);
@@ -5046,7 +5046,7 @@ static void dsi_init_output(struct dsi_data *dsi)
50465046
{
50475047
struct omap_dss_device *out = &dsi->output;
50485048

5049-
out->dev = &dsi->pdev->dev;
5049+
out->dev = dsi->dev;
50505050
out->id = dsi->module_id == 0 ?
50515051
OMAP_DSS_OUTPUT_DSI1 : OMAP_DSS_OUTPUT_DSI2;
50525052

@@ -5068,7 +5068,7 @@ static void dsi_uninit_output(struct dsi_data *dsi)
50685068

50695069
static int dsi_probe_of(struct dsi_data *dsi)
50705070
{
5071-
struct device_node *node = dsi->pdev->dev.of_node;
5071+
struct device_node *node = dsi->dev->of_node;
50725072
struct property *prop;
50735073
u32 lane_arr[10];
50745074
int len, num_pins;
@@ -5082,7 +5082,7 @@ static int dsi_probe_of(struct dsi_data *dsi)
50825082

50835083
prop = of_find_property(ep, "lanes", &len);
50845084
if (prop == NULL) {
5085-
dev_err(&dsi->pdev->dev, "failed to find lane data\n");
5085+
dev_err(dsi->dev, "failed to find lane data\n");
50865086
r = -EINVAL;
50875087
goto err;
50885088
}
@@ -5091,14 +5091,14 @@ static int dsi_probe_of(struct dsi_data *dsi)
50915091

50925092
if (num_pins < 4 || num_pins % 2 != 0 ||
50935093
num_pins > dsi->num_lanes_supported * 2) {
5094-
dev_err(&dsi->pdev->dev, "bad number of lanes\n");
5094+
dev_err(dsi->dev, "bad number of lanes\n");
50955095
r = -EINVAL;
50965096
goto err;
50975097
}
50985098

50995099
r = of_property_read_u32_array(ep, "lanes", lane_arr, num_pins);
51005100
if (r) {
5101-
dev_err(&dsi->pdev->dev, "failed to read lane data\n");
5101+
dev_err(dsi->dev, "failed to read lane data\n");
51025102
goto err;
51035103
}
51045104

@@ -5108,7 +5108,7 @@ static int dsi_probe_of(struct dsi_data *dsi)
51085108

51095109
r = dsi_configure_pins(&dsi->output, &pin_cfg);
51105110
if (r) {
5111-
dev_err(&dsi->pdev->dev, "failed to configure pins");
5111+
dev_err(dsi->dev, "failed to configure pins");
51125112
goto err;
51135113
}
51145114

@@ -5214,7 +5214,7 @@ static int dsi_init_pll_data(struct dss_device *dss, struct dsi_data *dsi)
52145214
struct clk *clk;
52155215
int r;
52165216

5217-
clk = devm_clk_get(&dsi->pdev->dev, "sys_clk");
5217+
clk = devm_clk_get(dsi->dev, "sys_clk");
52185218
if (IS_ERR(clk)) {
52195219
DSSERR("can't get sys_clk\n");
52205220
return PTR_ERR(clk);
@@ -5317,7 +5317,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
53175317
return -ENOMEM;
53185318

53195319
dsi->dss = dss;
5320-
dsi->pdev = pdev;
5320+
dsi->dev = dev;
53215321
dev_set_drvdata(dev, dsi);
53225322

53235323
spin_lock_init(&dsi->irq_lock);

0 commit comments

Comments
 (0)