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

rx51_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
f70d739a 8ff3fb29

+1 -4
+1 -4
drivers/power/rx51_battery.c
··· 216 216 di->bat.get_property = rx51_battery_get_property; 217 217 218 218 ret = power_supply_register(di->dev, &di->bat); 219 - if (ret) { 220 - platform_set_drvdata(pdev, NULL); 219 + if (ret) 221 220 return ret; 222 - } 223 221 224 222 return 0; 225 223 } ··· 227 229 struct rx51_device_info *di = platform_get_drvdata(pdev); 228 230 229 231 power_supply_unregister(&di->bat); 230 - platform_set_drvdata(pdev, NULL); 231 232 232 233 return 0; 233 234 }