Re: [PATCH V2 2/2] ARM: davinci: restart: fix wdt to machine restartwith DT

From: Sekhar Nori
Date: Sat Feb 09 2013 - 12:24:04 EST


On 2/8/2013 8:34 AM, Kumar, Anil wrote:

> On Thu, Feb 07, 2013 at 23:45:53, Nori, Sekhar wrote:

>> On 2/6/2013 9:30 AM, Kumar, Anil wrote:

>>> diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
>>> index 2d5502d..1df68fd 100644
>>> --- a/arch/arm/mach-davinci/devices-da8xx.c
>>> +++ b/arch/arm/mach-davinci/devices-da8xx.c
>>> @@ -359,7 +359,7 @@ static struct resource da8xx_watchdog_resources[] = {
>>> },
>>> };
>>>
>>> -struct platform_device da8xx_wdt_device = {
>>> +static struct platform_device da8xx_wdt_device = {
>>
>> Making of da8xx_wdt_device static should find a mention in description.
>
> Ok,
> I made da8xx_wdt_device structure static as it is used only
> in file. I will update description for this.
>
>>
>>> .name = "watchdog",
>>> .id = -1,
>>> .num_resources = ARRAY_SIZE(da8xx_watchdog_resources),
>>> @@ -368,7 +368,17 @@ struct platform_device da8xx_wdt_device = {
>>>
>>> void da8xx_restart(char mode, const char *cmd)
>>> {
>>> - davinci_watchdog_reset(&da8xx_wdt_device);
>>> + struct device *dev = NULL;
>>> + struct platform_device *wdt_device = NULL;
>>
>> No need to initialize these variables here.
>
> Ok,
> I think no need to define wdt_device, can be used as
>
> davinci_watchdog_reset(to_platform_device(dev));
>
>>
>>> +
>>> + dev = bus_find_device_by_name(&platform_bus_type, NULL, "watchdog");
>>> + if (!dev) {
>>> + pr_err("wdt device not found to machine reboot\n");
>>
>> Rather: "%s: failed to find watchdog device", __func__
>
> ok

Since time is short and I really want to be able to reboot
when using DT in v3.9, I went ahead and fixed these comments.
Updated patch follows. I tested it on DA850 EVM.

Thanks,
Sekhar

----8<----