From f11c35e18150a347f6251a9fecd14290c25b743a Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Mon, 20 Sep 2021 11:05:20 +0200 Subject: [PATCH] platform/chrome: cros_ec_sensorhub: simplify getting .driver_data We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang Signed-off-by: Enric Balletbo i Serra Link: https://lore.kernel.org/r/20210920090522.23784-9-wsa+renesas@sang-engineering.com --- drivers/platform/chrome/cros_ec_sensorhub.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_sensorhub.c b/drivers/platform/chrome/cros_ec_sensorhub.c index 9c4af76a9956..31fb8bdaad5a 100644 --- a/drivers/platform/chrome/cros_ec_sensorhub.c +++ b/drivers/platform/chrome/cros_ec_sensorhub.c @@ -224,8 +224,7 @@ static int cros_ec_sensorhub_probe(struct platform_device *pdev) */ static int cros_ec_sensorhub_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct cros_ec_sensorhub *sensorhub = platform_get_drvdata(pdev); + struct cros_ec_sensorhub *sensorhub = dev_get_drvdata(dev); struct cros_ec_dev *ec = sensorhub->ec; if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE_FIFO)) @@ -235,8 +234,7 @@ static int cros_ec_sensorhub_suspend(struct device *dev) static int cros_ec_sensorhub_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct cros_ec_sensorhub *sensorhub = platform_get_drvdata(pdev); + struct cros_ec_sensorhub *sensorhub = dev_get_drvdata(dev); struct cros_ec_dev *ec = sensorhub->ec; if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE_FIFO))