forked from Minki/linux
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 <wsa+renesas@sang-engineering.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20210920090522.23784-9-wsa+renesas@sang-engineering.com
This commit is contained in:
parent
f636fb044a
commit
f11c35e181
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user