aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-adp5520.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-adp5520.c')
-rw-r--r--drivers/gpio/gpio-adp5520.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-adp5520.c b/drivers/gpio/gpio-adp5520.c
index 8afa95f831b1..f33f78dcadaa 100644
--- a/drivers/gpio/gpio-adp5520.c
+++ b/drivers/gpio/gpio-adp5520.c
@@ -105,7 +105,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
105 return -ENODEV; 105 return -ENODEV;
106 } 106 }
107 107
108 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 108 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
109 if (dev == NULL) { 109 if (dev == NULL) {
110 dev_err(&pdev->dev, "failed to alloc memory\n"); 110 dev_err(&pdev->dev, "failed to alloc memory\n");
111 return -ENOMEM; 111 return -ENOMEM;
@@ -163,7 +163,6 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
163 return 0; 163 return 0;
164 164
165err: 165err:
166 kfree(dev);
167 return ret; 166 return ret;
168} 167}
169 168
@@ -180,7 +179,6 @@ static int adp5520_gpio_remove(struct platform_device *pdev)
180 return ret; 179 return ret;
181 } 180 }
182 181
183 kfree(dev);
184 return 0; 182 return 0;
185} 183}
186 184