Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

jz4740-battery: Remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or on
probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is
not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>

authored by

Jingoo Han and committed by
Anton Vorontsov
8ff3fb29 6fe6a40a

+1 -3
+1 -3
drivers/power/jz4740-battery.c
··· 292 292 jz_battery); 293 293 if (ret) { 294 294 dev_err(&pdev->dev, "Failed to request irq %d\n", ret); 295 - goto err; 295 + return ret; 296 296 } 297 297 disable_irq(jz_battery->irq); 298 298 ··· 349 349 gpio_free(jz_battery->pdata->gpio_charge); 350 350 err_free_irq: 351 351 free_irq(jz_battery->irq, jz_battery); 352 - err: 353 - platform_set_drvdata(pdev, NULL); 354 352 return ret; 355 353 } 356 354