power: supply: axp20x_usb_power: fix warning on 64bit
authorMichal Suchanek <msuchanek@suse.de>
Tue, 10 Jan 2017 17:48:12 +0000 (18:48 +0100)
committerSebastian Reichel <sre@kernel.org>
Thu, 12 Jan 2017 00:03:53 +0000 (01:03 +0100)
Casting of_device_get_match_data return value to int causes warning on 64bit
architectures.

../drivers/power/supply/axp20x_usb_power.c: In function
'axp20x_usb_power_probe':
../drivers/power/supply/axp20x_usb_power.c:297:21: warning: cast from
pointer to integer of different size [-Wpointer-to-int-cast]

Fixes: 0dcc70ca8644 ("power: supply: axp20x_usb_power: use of_device_id
    data field instead of device_is_compatible")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/axp20x_usb_power.c
include/linux/mfd/axp20x.h

index 1bcb02551e028e911c2818d0b2873ebda95bd89c..632a33fe2d54bf22aa3308e0b2ea3b507b3b2dc3 100644 (file)
@@ -48,7 +48,7 @@ struct axp20x_usb_power {
        struct device_node *np;
        struct regmap *regmap;
        struct power_supply *supply;
-       int axp20x_id;
+       enum axp20x_variants axp20x_id;
 };
 
 static irqreturn_t axp20x_usb_power_irq(int irq, void *devid)
@@ -294,7 +294,8 @@ static int axp20x_usb_power_probe(struct platform_device *pdev)
        if (!power)
                return -ENOMEM;
 
-       power->axp20x_id = (int)of_device_get_match_data(&pdev->dev);
+       power->axp20x_id = (enum axp20x_variants)of_device_get_match_data(
+                                                               &pdev->dev);
 
        power->np = pdev->dev.of_node;
        power->regmap = axp20x->regmap;
index 812806d6319b5f1e1e40404e01ebcdc73df6a2aa..f848ee86a339bf37d662459b1443edbd8580e968 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <linux/regmap.h>
 
-enum {
+enum axp20x_variants {
        AXP152_ID = 0,
        AXP202_ID,
        AXP209_ID,