[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <519ED9E6.8050309@huawei.com>
Date: Fri, 24 May 2013 11:09:26 +0800
From: Libo Chen <clbchenlibo.chen@...wei.com>
To: "Zhang, Sonic" <Sonic.Zhang@...log.com>
CC: Libo Chen <libo.chen@...wei.com>,
"wsa@...-dreams.de" <wsa@...-dreams.de>,
"guz.fnst@...fujitsu.com" <guz.fnst@...fujitsu.com>,
"uclinux-dist-devel@...ckfin.uclinux.org"
<uclinux-dist-devel@...ckfin.uclinux.org>,
"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"lizefan@...wei.com" <lizefan@...wei.com>
Subject: Re: [PATCH RFC v3 1/3] i2c: i2c-bfin-twi: convert to devm_* API
On 2013/5/24 10:49, Zhang, Sonic wrote:
>> >- iface = kzalloc(sizeof(struct bfin_twi_iface), GFP_KERNEL);
>> >+ iface = devm_kzalloc(&pdev->dev, sizeof(struct bfin_twi_iface),
>> >+ GFP_KERNEL);
>> > if (!iface) {
>> > dev_err(&pdev->dev, "Cannot allocate memory\n");
>> >- rc = -ENOMEM;
>> >- goto out_error_nomem;
>> >+ return -ENOMEM;
>> > }
>> >
>> > spin_lock_init(&(iface->lock));
>> >
>> > /* Find and map our resources */
>> > res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> >- if (res == NULL) {
>> >- dev_err(&pdev->dev, "Cannot get IORESOURCE_MEM\n");
>> >- rc = -ENOENT;
>> >- goto out_error_get_res;
>> >- }
> Why remove the resource mem check?
>
> Regards,
>
> Sonic
devm_ioremap_resource() had done for us, you can refernce the function`comment.
Thanks,
Libo
--
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