RE: Problem with /proc/iomem on ARM
From: H Hartley Sweeten
Date: Wed Jul 08 2009 - 18:10:09 EST
On Wednesday, July 01, 2009 11:47 AM, Kay Sievers wrote:
> On Wed, Jul 1, 2009 at 20:24, H Hartley Sweeten wrote:
>> On Wednesday, July 01, 2009 11:13 AM, Kay Sievers wrote:
>>>> The serial ports on my system are amba bus devices.
>>>>
>>>>> After all, it seems like this should be fixed in arm somewhere,
>>>>> not to copy and store internal driver core pointers, but use the
>>>>> device itself to retrieve the values.
>>>>
>>>> Maybe the problem is in drivers/amba/bus.c? amba_device_register()
>>>> does:
>>>>
>>>> Â Â Â Âdev->res.name = dev_name(&dev->dev);
>>>
>>> Looks like. If you get the name directly from dev->init_name. Does
>>> that work?
>>>
>>
>> The following patch does fix /proc/iomem for the amba uarts on my
>> system. Is this the correct approach to fixing the issue?
>
> Looks fine to work around the issue that statically allocated struct
> devices can cause. The proper fix would be to convert them to dynamic
> objects and get rid of .init_name entirely.
Disregard.
Russell King added a patch that fixed the issue. I just showed up.
commit 557dca5f48a45df88a73e69ee0700cfd4e2358c9
Author: Russell King <rmk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun Jul 5 22:39:08 2009 +0100
[ARM] amba: fix amba device resources
AMBA device resources were being reported as:
10004000-10004fff : <BAD>
This is because dev_name() was returning NULL prior to device_register.
Ensure that the struct device is properly initialized, and the name is
set before adding it to the device tree.
Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
Thanks,
Hartley
èº{.nÇ+·®+%Ëlzwm
ébëæìr¸zX§»®w¥{ayºÊÚë,j¢f£¢·hàz¹®w¥¢¸¢·¦j:+v¨wèjØm¶ÿ¾«êçzZ+ùÝj"ú!¶iOæ¬z·vØ^¶m§ÿðÃnÆàþY&