From: Kenneth Heitke <kheitke@codeaurora.org>
To: Sundar <sunder.svit@gmail.com>
Cc: khali@linux-fr.org, ben-linux@fluff.org,
srinidhi.kasagar@stericsson.com, tsoni@codeaurora.org,
linus.walleij@stericsson.com, linux-arm-msm@vger.kernel.org,
arve@android.com, swetland@google.com, sdharia@codeaurora.com,
David Brown <davidb@codeaurora.org>,
Daniel Walker <dwalker@codeaurora.org>,
Bryan Huntsman <bryanh@codeaurora.org>,
Russell King <linux@arm.linux.org.uk>,
Crane Cai <crane.cai@amd.com>,
Samuel Ortiz <sameo@linux.intel.com>,
Ralf Baechle <ralf@linux-mips.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH v3] i2c: QUP based bus driver for Qualcomm MSM chipsets
Date: Thu, 09 Sep 2010 14:52:19 -0600 [thread overview]
Message-ID: <4C894903.1050909@codeaurora.org> (raw)
In-Reply-To: <AANLkTimHQ=ag5z+SKbGrm5BD-eF+xcDuKp4R_=4tf3cP@mail.gmail.com>
Sundar wrote:
> Hi Kenneth,
>
> just some error codes and leaks if I am right :)
>
> On Wed, Sep 8, 2010 at 6:29 AM, Kenneth Heitke <kheitke@codeaurora.org> wrote:
>> +
>> +static int __devinit
>> +qup_i2c_probe(struct platform_device *pdev)
>> +{
>> +
>> + qup_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM,
>> + "qup_phys_addr");
>> + if (!qup_mem) {
>> + dev_err(&pdev->dev, "no qup mem resource?\n");
>> + return -ENODEV;
>
> I think this should be -ENXIO instead of -ENODEV?
>
>> + gsbi_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM,
>> + "gsbi_qup_i2c_addr");
>> + if (!gsbi_mem) {
>> + dev_err(&pdev->dev, "no gsbi mem resource?\n");
>> + return -ENODEV;
>
> Ditto here.
>
>> + in_irq = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
>> + "qup_in_intr");
>> +
>> + out_irq = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
>> + "qup_out_intr");
>> +
>> + err_irq = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
>> + "qup_err_intr");
>> + if (!err_irq) {
>> + dev_err(&pdev->dev, "no error irq resource?\n");
>> + return -ENODEV;
>> + }
>
> All the same here too?
>
>> +
>> + qup_io = devm_request_mem_region(&pdev->dev, qup_mem->start,
>> + resource_size(qup_mem), pdev->name);
>> + if (!qup_io) {
>> + dev_err(&pdev->dev, "QUP region already claimed\n");
>> + return -EBUSY;
>> + }
>> +
>> + gsbi_io = devm_request_mem_region(&pdev->dev, gsbi_mem->start,
>> + resource_size(gsbi_mem), pdev->name);
>> + if (!gsbi_io) {
>> + dev_err(&pdev->dev, "GSBI region already claimed\n");
>> + return -EBUSY;
>> + }
>> +
>> + dev = devm_kzalloc(&pdev->dev, sizeof(struct qup_i2c_dev), GFP_KERNEL);
>
> [..]
>
>> + if (!dev->base)
>> + return -ENOMEM;
>
> Missing *_kzfree whilst returning?
>
>> + dev->gsbi = devm_ioremap(&pdev->dev,
>> + gsbi_mem->start, resource_size(gsbi_mem));
>> + if (!dev->gsbi)
>> + return -ENOMEM;
>> +
>> + clk = clk_get(&pdev->dev, "qup_clk");
>> + if (IS_ERR(clk)) {
>> + dev_err(&pdev->dev, "Could not get clock\n");
>> + ret = PTR_ERR(clk);
>> + goto err_clk_get_failed;
>
> Will not the devm_iounmap be needed here?
>
> Thanx!
> Sundar
>
Hopefully no leaks since I am using the devm_ calls. The resources
should be freed up automatically on device release and if the probe
function fails. Please let me know if this assumption is not correct.
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
WARNING: multiple messages have this Message-ID (diff)
From: Kenneth Heitke <kheitke-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Sundar <sunder.svit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org,
ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org,
srinidhi.kasagar-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
tsoni-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
arve-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org,
swetland-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
sdharia-sgV2jX0FEOLY0TyS/+Ba5Q@public.gmane.org,
David Brown <davidb-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Daniel Walker <dwalker-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Bryan Huntsman <bryanh-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
Crane Cai <crane.cai-5C7GfCeVMHo@public.gmane.org>,
Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3] i2c: QUP based bus driver for Qualcomm MSM chipsets
Date: Thu, 09 Sep 2010 14:52:19 -0600 [thread overview]
Message-ID: <4C894903.1050909@codeaurora.org> (raw)
In-Reply-To: <AANLkTimHQ=ag5z+SKbGrm5BD-eF+xcDuKp4R_=4tf3cP-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Sundar wrote:
> Hi Kenneth,
>
> just some error codes and leaks if I am right :)
>
> On Wed, Sep 8, 2010 at 6:29 AM, Kenneth Heitke <kheitke-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> wrote:
>> +
>> +static int __devinit
>> +qup_i2c_probe(struct platform_device *pdev)
>> +{
>> +
>> + qup_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM,
>> + "qup_phys_addr");
>> + if (!qup_mem) {
>> + dev_err(&pdev->dev, "no qup mem resource?\n");
>> + return -ENODEV;
>
> I think this should be -ENXIO instead of -ENODEV?
>
>> + gsbi_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM,
>> + "gsbi_qup_i2c_addr");
>> + if (!gsbi_mem) {
>> + dev_err(&pdev->dev, "no gsbi mem resource?\n");
>> + return -ENODEV;
>
> Ditto here.
>
>> + in_irq = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
>> + "qup_in_intr");
>> +
>> + out_irq = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
>> + "qup_out_intr");
>> +
>> + err_irq = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
>> + "qup_err_intr");
>> + if (!err_irq) {
>> + dev_err(&pdev->dev, "no error irq resource?\n");
>> + return -ENODEV;
>> + }
>
> All the same here too?
>
>> +
>> + qup_io = devm_request_mem_region(&pdev->dev, qup_mem->start,
>> + resource_size(qup_mem), pdev->name);
>> + if (!qup_io) {
>> + dev_err(&pdev->dev, "QUP region already claimed\n");
>> + return -EBUSY;
>> + }
>> +
>> + gsbi_io = devm_request_mem_region(&pdev->dev, gsbi_mem->start,
>> + resource_size(gsbi_mem), pdev->name);
>> + if (!gsbi_io) {
>> + dev_err(&pdev->dev, "GSBI region already claimed\n");
>> + return -EBUSY;
>> + }
>> +
>> + dev = devm_kzalloc(&pdev->dev, sizeof(struct qup_i2c_dev), GFP_KERNEL);
>
> [..]
>
>> + if (!dev->base)
>> + return -ENOMEM;
>
> Missing *_kzfree whilst returning?
>
>> + dev->gsbi = devm_ioremap(&pdev->dev,
>> + gsbi_mem->start, resource_size(gsbi_mem));
>> + if (!dev->gsbi)
>> + return -ENOMEM;
>> +
>> + clk = clk_get(&pdev->dev, "qup_clk");
>> + if (IS_ERR(clk)) {
>> + dev_err(&pdev->dev, "Could not get clock\n");
>> + ret = PTR_ERR(clk);
>> + goto err_clk_get_failed;
>
> Will not the devm_iounmap be needed here?
>
> Thanx!
> Sundar
>
Hopefully no leaks since I am using the devm_ calls. The resources
should be freed up automatically on device release and if the probe
function fails. Please let me know if this assumption is not correct.
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
WARNING: multiple messages have this Message-ID (diff)
From: kheitke@codeaurora.org (Kenneth Heitke)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] i2c: QUP based bus driver for Qualcomm MSM chipsets
Date: Thu, 09 Sep 2010 14:52:19 -0600 [thread overview]
Message-ID: <4C894903.1050909@codeaurora.org> (raw)
In-Reply-To: <AANLkTimHQ=ag5z+SKbGrm5BD-eF+xcDuKp4R_=4tf3cP@mail.gmail.com>
Sundar wrote:
> Hi Kenneth,
>
> just some error codes and leaks if I am right :)
>
> On Wed, Sep 8, 2010 at 6:29 AM, Kenneth Heitke <kheitke@codeaurora.org> wrote:
>> +
>> +static int __devinit
>> +qup_i2c_probe(struct platform_device *pdev)
>> +{
>> +
>> + qup_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM,
>> + "qup_phys_addr");
>> + if (!qup_mem) {
>> + dev_err(&pdev->dev, "no qup mem resource?\n");
>> + return -ENODEV;
>
> I think this should be -ENXIO instead of -ENODEV?
>
>> + gsbi_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM,
>> + "gsbi_qup_i2c_addr");
>> + if (!gsbi_mem) {
>> + dev_err(&pdev->dev, "no gsbi mem resource?\n");
>> + return -ENODEV;
>
> Ditto here.
>
>> + in_irq = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
>> + "qup_in_intr");
>> +
>> + out_irq = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
>> + "qup_out_intr");
>> +
>> + err_irq = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
>> + "qup_err_intr");
>> + if (!err_irq) {
>> + dev_err(&pdev->dev, "no error irq resource?\n");
>> + return -ENODEV;
>> + }
>
> All the same here too?
>
>> +
>> + qup_io = devm_request_mem_region(&pdev->dev, qup_mem->start,
>> + resource_size(qup_mem), pdev->name);
>> + if (!qup_io) {
>> + dev_err(&pdev->dev, "QUP region already claimed\n");
>> + return -EBUSY;
>> + }
>> +
>> + gsbi_io = devm_request_mem_region(&pdev->dev, gsbi_mem->start,
>> + resource_size(gsbi_mem), pdev->name);
>> + if (!gsbi_io) {
>> + dev_err(&pdev->dev, "GSBI region already claimed\n");
>> + return -EBUSY;
>> + }
>> +
>> + dev = devm_kzalloc(&pdev->dev, sizeof(struct qup_i2c_dev), GFP_KERNEL);
>
> [..]
>
>> + if (!dev->base)
>> + return -ENOMEM;
>
> Missing *_kzfree whilst returning?
>
>> + dev->gsbi = devm_ioremap(&pdev->dev,
>> + gsbi_mem->start, resource_size(gsbi_mem));
>> + if (!dev->gsbi)
>> + return -ENOMEM;
>> +
>> + clk = clk_get(&pdev->dev, "qup_clk");
>> + if (IS_ERR(clk)) {
>> + dev_err(&pdev->dev, "Could not get clock\n");
>> + ret = PTR_ERR(clk);
>> + goto err_clk_get_failed;
>
> Will not the devm_iounmap be needed here?
>
> Thanx!
> Sundar
>
Hopefully no leaks since I am using the devm_ calls. The resources
should be freed up automatically on device release and if the probe
function fails. Please let me know if this assumption is not correct.
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
next prev parent reply other threads:[~2010-09-09 20:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-08 0:59 [PATCH v3] i2c: QUP based bus driver for Qualcomm MSM chipsets Kenneth Heitke
2010-09-08 0:59 ` Kenneth Heitke
2010-09-08 0:59 ` Kenneth Heitke
2010-09-08 13:23 ` Trilok Soni
2010-09-08 13:23 ` Trilok Soni
2010-09-08 13:23 ` Trilok Soni
2010-09-09 19:01 ` Sundar
2010-09-09 19:01 ` Sundar
2010-09-09 19:01 ` Sundar
2010-09-09 20:52 ` Kenneth Heitke [this message]
2010-09-09 20:52 ` Kenneth Heitke
2010-09-09 20:52 ` Kenneth Heitke
2010-09-26 23:04 ` Ben Dooks
2010-09-26 23:04 ` Ben Dooks
2010-09-26 23:04 ` Ben Dooks
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=4C894903.1050909@codeaurora.org \
--to=kheitke@codeaurora.org \
--cc=arve@android.com \
--cc=ben-linux@fluff.org \
--cc=bryanh@codeaurora.org \
--cc=crane.cai@amd.com \
--cc=davidb@codeaurora.org \
--cc=dwalker@codeaurora.org \
--cc=khali@linux-fr.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=ralf@linux-mips.org \
--cc=sameo@linux.intel.com \
--cc=sdharia@codeaurora.com \
--cc=srinidhi.kasagar@stericsson.com \
--cc=sunder.svit@gmail.com \
--cc=swetland@google.com \
--cc=tsoni@codeaurora.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.