Skip to content

Commit 2473394

Browse files
Wolfram Sangmchehab
authored andcommitted
media: platform: exynos4-is: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 010b876 commit 2473394

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

drivers/media/platform/exynos4-is/media-dev.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,8 +1201,7 @@ static const struct media_device_ops fimc_md_ops = {
12011201
static ssize_t fimc_md_sysfs_show(struct device *dev,
12021202
struct device_attribute *attr, char *buf)
12031203
{
1204-
struct platform_device *pdev = to_platform_device(dev);
1205-
struct fimc_md *fmd = platform_get_drvdata(pdev);
1204+
struct fimc_md *fmd = dev_get_drvdata(dev);
12061205

12071206
if (fmd->user_subdev_api)
12081207
return strlcpy(buf, "Sub-device API (sub-dev)\n", PAGE_SIZE);
@@ -1214,8 +1213,7 @@ static ssize_t fimc_md_sysfs_store(struct device *dev,
12141213
struct device_attribute *attr,
12151214
const char *buf, size_t count)
12161215
{
1217-
struct platform_device *pdev = to_platform_device(dev);
1218-
struct fimc_md *fmd = platform_get_drvdata(pdev);
1216+
struct fimc_md *fmd = dev_get_drvdata(dev);
12191217
bool subdev_api;
12201218
int i;
12211219

drivers/media/platform/exynos4-is/mipi-csis.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,7 @@ static int s5pcsis_probe(struct platform_device *pdev)
891891

892892
static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
893893
{
894-
struct platform_device *pdev = to_platform_device(dev);
895-
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
894+
struct v4l2_subdev *sd = dev_get_drvdata(dev);
896895
struct csis_state *state = sd_to_csis_state(sd);
897896
int ret = 0;
898897

@@ -921,8 +920,7 @@ static int s5pcsis_pm_suspend(struct device *dev, bool runtime)
921920

922921
static int s5pcsis_pm_resume(struct device *dev, bool runtime)
923922
{
924-
struct platform_device *pdev = to_platform_device(dev);
925-
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
923+
struct v4l2_subdev *sd = dev_get_drvdata(dev);
926924
struct csis_state *state = sd_to_csis_state(sd);
927925
int ret = 0;
928926

0 commit comments

Comments
 (0)