[PATCH 5/7] S3C64XX: Add platform data and driver resources for IDE controller driver.
Thomas Abraham
thomas.ab at samsung.com
Mon Nov 2 01:13:27 EST 2009
On Sun, Nov 1, 2009 at 10:05 PM, Ben Dooks <ben-linux at fluff.org> wrote:
> On Sun, Nov 01, 2009 at 01:56:43PM +0900, Thomas Abraham wrote:
>> This patch adds the following for S3C IDE driver.
>> - IDE plafrom data strucure definition
>> - IDE driver resources
>> - IDE controller GPIO setup code
>> - IDE platform data setup code
>> - IDE platform device definition
>>
>> +void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata)
>> +{
>> + struct s3c_ide_platdata *pd;
>> +
>> + pd = (struct s3c_ide_platdata *)kmemdup(pdata,
>> + sizeof(struct s3c_ide_platdata), GFP_KERNEL);
>
> you do not need pd = (struct s3c_ide_platdata *), the result of kmemdup
> is 'void *' and thus can be cast to 'struct s3c_ide_platdata *'. Removing
> this will make the code flow better.
>
> doing:
>
> if (!pd)
> printk(KERN_ERR "%s: no memory for platform data\n", __func__);
> else
> s3c_device_cfcon.dev.platform_data = pd;
>
> would be better.
Ok. I will modify the code.
>
> other than the comments, this looks ok.
>
> --
> Ben
More information about the linux-arm-kernel
mailing list