]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
thermal: int340x_thermal: int3400_thermal: simplify getting .driver_data
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 21 Oct 2018 20:00:48 +0000 (22:00 +0200)
committerZhang Rui <rui.zhang@intel.com>
Fri, 30 Nov 2018 08:46:55 +0000 (16:46 +0800)
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>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/int340x_thermal/int3400_thermal.c

index e26b01c05e8224cec140633bb3b47787759662db..61ca7ce3624ed4298c6b0b99ee2d5e63f0f534cc 100644 (file)
@@ -48,8 +48,7 @@ static ssize_t available_uuids_show(struct device *dev,
                                    struct device_attribute *attr,
                                    char *buf)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct int3400_thermal_priv *priv = platform_get_drvdata(pdev);
+       struct int3400_thermal_priv *priv = dev_get_drvdata(dev);
        int i;
        int length = 0;
 
@@ -68,8 +67,7 @@ static ssize_t available_uuids_show(struct device *dev,
 static ssize_t current_uuid_show(struct device *dev,
                                 struct device_attribute *devattr, char *buf)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct int3400_thermal_priv *priv = platform_get_drvdata(pdev);
+       struct int3400_thermal_priv *priv = dev_get_drvdata(dev);
 
        if (priv->uuid_bitmap & (1 << priv->current_uuid_index))
                return sprintf(buf, "%s\n",
@@ -82,8 +80,7 @@ static ssize_t current_uuid_store(struct device *dev,
                                  struct device_attribute *attr,
                                  const char *buf, size_t count)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct int3400_thermal_priv *priv = platform_get_drvdata(pdev);
+       struct int3400_thermal_priv *priv = dev_get_drvdata(dev);
        int i;
 
        for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; ++i) {