Skip to content

Commit 0b5e0f4

Browse files
JuliaLawallLee Jones
authored andcommitted
backlight/video: Use Platform getter/setter functions
Use getter and setter functions, for platform_device structures and a spi_device structure. Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent 57e0d7b commit 0b5e0f4

10 files changed

Lines changed: 16 additions & 16 deletions

File tree

drivers/video/backlight/qcom-wled.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ static int wled_probe(struct platform_device *pdev)
16921692

16931693
static int wled_remove(struct platform_device *pdev)
16941694
{
1695-
struct wled *wled = dev_get_drvdata(&pdev->dev);
1695+
struct wled *wled = platform_get_drvdata(pdev);
16961696

16971697
mutex_destroy(&wled->lock);
16981698
cancel_delayed_work_sync(&wled->ovp_work);

drivers/video/fbdev/amifb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,7 +3736,7 @@ static int __init amifb_probe(struct platform_device *pdev)
37363736
if (err)
37373737
goto free_irq;
37383738

3739-
dev_set_drvdata(&pdev->dev, info);
3739+
platform_set_drvdata(pdev, info);
37403740

37413741
err = register_framebuffer(info);
37423742
if (err)
@@ -3764,7 +3764,7 @@ static int __init amifb_probe(struct platform_device *pdev)
37643764

37653765
static int __exit amifb_remove(struct platform_device *pdev)
37663766
{
3767-
struct fb_info *info = dev_get_drvdata(&pdev->dev);
3767+
struct fb_info *info = platform_get_drvdata(pdev);
37683768

37693769
unregister_framebuffer(info);
37703770
fb_dealloc_cmap(&info->cmap);

drivers/video/fbdev/da8xx-fb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ static void lcd_da8xx_cpufreq_deregister(struct da8xx_fb_par *par)
10661066

10671067
static int fb_remove(struct platform_device *dev)
10681068
{
1069-
struct fb_info *info = dev_get_drvdata(&dev->dev);
1069+
struct fb_info *info = platform_get_drvdata(dev);
10701070
struct da8xx_fb_par *par = info->par;
10711071
int ret;
10721072

@@ -1482,7 +1482,7 @@ static int fb_probe(struct platform_device *device)
14821482
da8xx_fb_var.activate = FB_ACTIVATE_FORCE;
14831483
fb_set_var(da8xx_fb_info, &da8xx_fb_var);
14841484

1485-
dev_set_drvdata(&device->dev, da8xx_fb_info);
1485+
platform_set_drvdata(device, da8xx_fb_info);
14861486

14871487
/* initialize the vsync wait queue */
14881488
init_waitqueue_head(&par->vsync_wait);

drivers/video/fbdev/imxfb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
657657
static int imxfb_init_fbinfo(struct platform_device *pdev)
658658
{
659659
struct imx_fb_platform_data *pdata = dev_get_platdata(&pdev->dev);
660-
struct fb_info *info = dev_get_drvdata(&pdev->dev);
660+
struct fb_info *info = platform_get_drvdata(pdev);
661661
struct imxfb_info *fbi = info->par;
662662
struct device_node *np;
663663

drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ static struct omap_dss_driver lb035q02_ops = {
239239
static int lb035q02_probe_of(struct spi_device *spi)
240240
{
241241
struct device_node *node = spi->dev.of_node;
242-
struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
242+
struct panel_drv_data *ddata = spi_get_drvdata(spi);
243243
struct omap_dss_device *in;
244244
struct gpio_desc *gpio;
245245

@@ -277,7 +277,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi)
277277
if (ddata == NULL)
278278
return -ENOMEM;
279279

280-
dev_set_drvdata(&spi->dev, ddata);
280+
spi_set_drvdata(spi, ddata);
281281

282282
ddata->spi = spi;
283283

@@ -318,7 +318,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi)
318318

319319
static int lb035q02_panel_spi_remove(struct spi_device *spi)
320320
{
321-
struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
321+
struct panel_drv_data *ddata = spi_get_drvdata(spi);
322322
struct omap_dss_device *dssdev = &ddata->dssdev;
323323
struct omap_dss_device *in = ddata->in;
324324

drivers/video/fbdev/omap2/omapfb/dss/dpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev)
5555
/* only used in non-DT mode */
5656
static struct dpi_data *dpi_get_data_from_pdev(struct platform_device *pdev)
5757
{
58-
return dev_get_drvdata(&pdev->dev);
58+
return platform_get_drvdata(pdev);
5959
}
6060

6161
static struct dss_pll *dpi_get_pll(enum omap_channel channel)
@@ -784,7 +784,7 @@ static int dpi_bind(struct device *dev, struct device *master, void *data)
784784

785785
dpi->pdev = pdev;
786786

787-
dev_set_drvdata(&pdev->dev, dpi);
787+
platform_set_drvdata(pdev, dpi);
788788

789789
mutex_init(&dpi->lock);
790790

drivers/video/fbdev/omap2/omapfb/dss/dsi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ module_param(dsi_perf, bool, 0644);
399399

400400
static inline struct dsi_data *dsi_get_dsidrv_data(struct platform_device *dsidev)
401401
{
402-
return dev_get_drvdata(&dsidev->dev);
402+
return platform_get_drvdata(dsidev);
403403
}
404404

405405
static inline struct platform_device *dsi_get_dsidev_from_dssdev(struct omap_dss_device *dssdev)
@@ -5272,7 +5272,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
52725272
return -ENOMEM;
52735273

52745274
dsi->pdev = dsidev;
5275-
dev_set_drvdata(&dsidev->dev, dsi);
5275+
platform_set_drvdata(dsidev, dsi);
52765276

52775277
spin_lock_init(&dsi->irq_lock);
52785278
spin_lock_init(&dsi->errors_lock);

drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)
672672
int irq;
673673

674674
hdmi.pdev = pdev;
675-
dev_set_drvdata(&pdev->dev, &hdmi);
675+
platform_set_drvdata(pdev, &hdmi);
676676

677677
mutex_init(&hdmi.lock);
678678
spin_lock_init(&hdmi.audio_playing_lock);

drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data)
713713
int irq;
714714

715715
hdmi.pdev = pdev;
716-
dev_set_drvdata(&pdev->dev, &hdmi);
716+
platform_set_drvdata(pdev, &hdmi);
717717

718718
mutex_init(&hdmi.lock);
719719
spin_lock_init(&hdmi.audio_playing_lock);

drivers/video/fbdev/xilinxfb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
472472
if (of_find_property(pdev->dev.of_node, "rotate-display", NULL))
473473
pdata.rotate_screen = 1;
474474

475-
dev_set_drvdata(&pdev->dev, drvdata);
475+
platform_set_drvdata(pdev, drvdata);
476476
return xilinxfb_assign(pdev, drvdata, &pdata);
477477
}
478478

0 commit comments

Comments
 (0)