Skip to content

Commit f11c35e

Browse files
Wolfram SangEnric Balletbo i Serra
authored andcommitted
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 <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f636fb0 commit f11c35e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/platform/chrome/cros_ec_sensorhub.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,7 @@ static int cros_ec_sensorhub_probe(struct platform_device *pdev)
224224
*/
225225
static int cros_ec_sensorhub_suspend(struct device *dev)
226226
{
227-
struct platform_device *pdev = to_platform_device(dev);
228-
struct cros_ec_sensorhub *sensorhub = platform_get_drvdata(pdev);
227+
struct cros_ec_sensorhub *sensorhub = dev_get_drvdata(dev);
229228
struct cros_ec_dev *ec = sensorhub->ec;
230229

231230
if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE_FIFO))
@@ -235,8 +234,7 @@ static int cros_ec_sensorhub_suspend(struct device *dev)
235234

236235
static int cros_ec_sensorhub_resume(struct device *dev)
237236
{
238-
struct platform_device *pdev = to_platform_device(dev);
239-
struct cros_ec_sensorhub *sensorhub = platform_get_drvdata(pdev);
237+
struct cros_ec_sensorhub *sensorhub = dev_get_drvdata(dev);
240238
struct cros_ec_dev *ec = sensorhub->ec;
241239

242240
if (cros_ec_check_features(ec, EC_FEATURE_MOTION_SENSE_FIFO))

0 commit comments

Comments
 (0)