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

bq27x00_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
30cf74b9 ddeeb8f9

-2
-2
drivers/power/bq27x00_battery.c
··· 966 966 return 0; 967 967 968 968 err_free: 969 - platform_set_drvdata(pdev, NULL); 970 969 kfree(di); 971 970 972 971 return ret; ··· 977 978 978 979 bq27x00_powersupply_unregister(di); 979 980 980 - platform_set_drvdata(pdev, NULL); 981 981 kfree(di); 982 982 983 983 return 0;