From 56ae1b8e420015f1428bf9443f1b3321ad789b02 Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Thu, 21 Feb 2013 16:44:31 -0800 Subject: drivers/rtc/rtc-ds2404.c: use module_platform_driver macro Remove removes some code duplication by using module_platform_driver(). Signed-off-by: Srinivas Kandagatla Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-ds2404.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'drivers/rtc/rtc-ds2404.c') diff --git a/drivers/rtc/rtc-ds2404.c b/drivers/rtc/rtc-ds2404.c index 5ea9df7c8c31..4539e37c2238 100644 --- a/drivers/rtc/rtc-ds2404.c +++ b/drivers/rtc/rtc-ds2404.c @@ -283,19 +283,7 @@ static struct platform_driver rtc_device_driver = { .owner = THIS_MODULE, }, }; - -static __init int ds2404_init(void) -{ - return platform_driver_register(&rtc_device_driver); -} - -static __exit void ds2404_exit(void) -{ - platform_driver_unregister(&rtc_device_driver); -} - -module_init(ds2404_init); -module_exit(ds2404_exit); +module_platform_driver(rtc_device_driver); MODULE_DESCRIPTION("DS2404 RTC"); MODULE_AUTHOR("Sven Schnelle"); -- cgit v1.2.3 From 0fae82378ad55a7dfd03f5f6fb092798d8019bc3 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 21 Feb 2013 16:45:26 -0800 Subject: rtc: rtc-ds2404: use dev_err() instead of printk() Fix the checkpatch warning as below: WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... Signed-off-by: Jingoo Han Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-ds2404.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/rtc/rtc-ds2404.c') diff --git a/drivers/rtc/rtc-ds2404.c b/drivers/rtc/rtc-ds2404.c index 4539e37c2238..b04fc4272fb3 100644 --- a/drivers/rtc/rtc-ds2404.c +++ b/drivers/rtc/rtc-ds2404.c @@ -70,7 +70,7 @@ static int ds2404_gpio_map(struct ds2404 *chip, struct platform_device *pdev, for (i = 0; i < ARRAY_SIZE(ds2404_gpio); i++) { err = gpio_request(ds2404_gpio[i].gpio, ds2404_gpio[i].name); if (err) { - printk(KERN_ERR "error mapping gpio %s: %d\n", + dev_err(&pdev->dev, "error mapping gpio %s: %d\n", ds2404_gpio[i].name, err); goto err_request; } @@ -177,7 +177,7 @@ static void ds2404_write_memory(struct device *dev, u16 offset, for (i = 0; i < length; i++) { if (out[i] != ds2404_read_byte(dev)) { - printk(KERN_ERR "read invalid data\n"); + dev_err(dev, "read invalid data\n"); return; } } -- cgit v1.2.3