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

rtc: rtc-sa1100: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or
on probe failure, since commit 0998d063100 ("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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jingoo Han and committed by
Linus Torvalds
66600bbe fb9b525e

+2 -6
+2 -6
drivers/rtc/rtc-sa1100.c
··· 249 249 250 250 ret = clk_prepare_enable(info->clk); 251 251 if (ret) 252 - goto err_enable_clk; 252 + return ret; 253 253 /* 254 254 * According to the manual we should be able to let RTTR be zero 255 255 * and then a default diviser for a 32.768KHz clock is used. ··· 303 303 return 0; 304 304 err_dev: 305 305 clk_disable_unprepare(info->clk); 306 - err_enable_clk: 307 - platform_set_drvdata(pdev, NULL); 308 306 return ret; 309 307 } 310 308 ··· 310 312 { 311 313 struct sa1100_rtc *info = platform_get_drvdata(pdev); 312 314 313 - if (info) { 315 + if (info) 314 316 clk_disable_unprepare(info->clk); 315 - platform_set_drvdata(pdev, NULL); 316 - } 317 317 318 318 return 0; 319 319 }