[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4DCC27F2.5030206@tilera.com>
Date: Thu, 12 May 2011 14:33:22 -0400
From: Chris Metcalf <cmetcalf@...era.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: <rtc-linux@...glegroups.com>, <linux-kernel@...r.kernel.org>,
Alessandro Zummo <a.zummo@...ertech.it>
Subject: Re: [rtc-linux] [PATCH] tile: add an RTC driver for the Tilera hypervisor
On 5/11/2011 6:44 PM, Andrew Morton wrote:
> On Wed, 4 May 2011 15:52:21 -0400
> Chris Metcalf <cmetcalf@...era.com> wrote:
>> This is a simple RTC driver that lets Tilera hardware boot up and
>> set the clock correctly.
>>
>> ...
>>
>> +static int __init tile_rtc_driver_init(void)
>> +{
>> + int err;
>> +
>> + err = platform_driver_register(&tile_rtc_platform_driver);
>> + if (err)
>> + return err;
>> +
>> + tile_rtc_platform_device = platform_device_alloc("rtc-tile", 0);
>> + if (tile_rtc_platform_device == NULL) {
>> + platform_driver_unregister(&tile_rtc_platform_driver);
>> + return -ENOMEM;
>> + }
>> +
>> + err = platform_device_add(tile_rtc_platform_device);
>> + if (err) {
>> + platform_device_put(tile_rtc_platform_device);
> should we have a platform_driver_unregister() here?
Thanks, good catch. I restructured this to look more like the rtc-test.c
initializer:
static int __init tile_rtc_driver_init(void)
{
int err;
err = platform_driver_register(&tile_rtc_platform_driver);
if (err)
return err;
tile_rtc_platform_device = platform_device_alloc("rtc-tile", 0);
if (tile_rtc_platform_device == NULL) {
err = -ENOMEM;
goto exit_driver_unregister;
}
err = platform_device_add(tile_rtc_platform_device);
if (err)
goto exit_device_put;
return 0;
exit_device_put:
platform_device_put(tile_rtc_platform_device);
exit_driver_unregister:
platform_driver_unregister(&tile_rtc_platform_driver);
return err;
}
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists