From: Libo Chen <clbchenlibo.chen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: "Zhang, Sonic" <Sonic.Zhang-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
Cc: Libo Chen <libo.chen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
"wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org"
<wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
"guz.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org"
<guz.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>,
"uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org"
<uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org>,
"linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org"
<lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH RFC v3 1/3] i2c: i2c-bfin-twi: convert to devm_* API
Date: Fri, 24 May 2013 11:09:26 +0800 [thread overview]
Message-ID: <519ED9E6.8050309@huawei.com> (raw)
In-Reply-To: <B168F8A49F4BCF4C84FD23DA5F6363EE010634-Nxh9ahLCS6GuVPpjEGsWsTcYPEmu4y7e@public.gmane.org>
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
WARNING: multiple messages have this Message-ID (diff)
From: Libo Chen <clbchenlibo.chen@huawei.com>
To: "Zhang, Sonic" <Sonic.Zhang@analog.com>
Cc: Libo Chen <libo.chen@huawei.com>,
"wsa@the-dreams.de" <wsa@the-dreams.de>,
"guz.fnst@cn.fujitsu.com" <guz.fnst@cn.fujitsu.com>,
"uclinux-dist-devel@blackfin.uclinux.org"
<uclinux-dist-devel@blackfin.uclinux.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lizefan@huawei.com" <lizefan@huawei.com>
Subject: Re: [PATCH RFC v3 1/3] i2c: i2c-bfin-twi: convert to devm_* API
Date: Fri, 24 May 2013 11:09:26 +0800 [thread overview]
Message-ID: <519ED9E6.8050309@huawei.com> (raw)
In-Reply-To: <B168F8A49F4BCF4C84FD23DA5F6363EE010634@NWD2MBX7.ad.analog.com>
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
next prev parent reply other threads:[~2013-05-24 3:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-23 12:00 [PATCH RFC v3 1/3] i2c: i2c-bfin-twi: convert to devm_* API Libo Chen
2013-05-23 12:00 ` Libo Chen
[not found] ` <1369310405-21112-1-git-send-email-libo.chen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-05-24 2:49 ` Zhang, Sonic
2013-05-24 2:49 ` Zhang, Sonic
[not found] ` <B168F8A49F4BCF4C84FD23DA5F6363EE010634-Nxh9ahLCS6GuVPpjEGsWsTcYPEmu4y7e@public.gmane.org>
2013-05-24 3:09 ` Libo Chen [this message]
2013-05-24 3:09 ` Libo Chen
2013-05-24 3:19 ` Sachin Kamat
2013-05-24 3:19 ` Sachin Kamat
[not found] ` <CAK9yfHx7ifnWjKCVc0Oju-28PdosF81OpVC5S5Vdj6hDSnfQfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-28 6:42 ` Libo Chen
2013-05-28 6:42 ` Libo Chen
[not found] ` <51A451CE.8070801-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-06-12 9:55 ` Wolfram Sang
2013-06-12 9:55 ` Wolfram Sang
2013-05-24 4:32 ` Zhang, Sonic
2013-05-24 4:32 ` Zhang, Sonic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=519ED9E6.8050309@huawei.com \
--to=clbchenlibo.chen-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=Sonic.Zhang-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org \
--cc=guz.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org \
--cc=libo.chen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.