All of lore.kernel.org
 help / color / mirror / Atom feed
From: sergei.shtylyov@cogentembedded.com (Sergei Shtylyov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 4/6] ARM: davinci: Add a remoteproc driver implementation for OMAP-L13x DSP
Date: Tue, 09 Apr 2013 17:49:02 +0400	[thread overview]
Message-ID: <51641C4E.5010800@cogentembedded.com> (raw)
In-Reply-To: <13514BD7FAEBA745BBD7D8A672905C1431230384@DFLE12.ent.ti.com>

Hello.

On 09-04-2013 3:55, Tivy, Robert wrote:

>>>> +static int da8xx_rproc_probe(struct platform_device *pdev)
>>>> +{
>>>> +       struct device *dev = &pdev->dev;
>>>> +       struct da8xx_rproc *drproc;
>>>> +       struct rproc *rproc;
>>>> +       struct irq_data *irq_data;
>>>> +       struct resource *bootreg_res;
>>>> +       struct resource *chipsig_res;
>>>> +       struct clk *dsp_clk;
>>>> +       void __iomem *chipsig;
>>>> +       void __iomem *bootreg;
>>>> +       int irq;
>>>> +       int ret;
>>>> +
>> [...]
>>>> +       bootreg = devm_request_and_ioremap(dev, bootreg_res);
>>>> +       if (!bootreg) {
>>>> +               dev_err(dev, "unable to map boot register\n");
>>>> +               return -EADDRNOTAVAIL;
>>>> +       }
>>>> +
>>>> +       chipsig = devm_request_and_ioremap(dev, chipsig_res);

>>      I suggest that you use more modern (yes, already a newer interface
>> :-)
>> devm_ioremap_resource() instead -- it returns the error code (as a
>> pointer)
>> in case of error, and it certainly doesn't require you to print error
>> messages.

> Thanks, will do.

> I appreciate the notice of a more modern function, it's really tough to keep up with the flurry of activity to the kernel.

> Regarding this change, should the code use
> 	return PTR_ERR(bootreg);
> or
> 	return PTR_RET(bootreg);

    The former, to avoid duplicate IS_ERR() check.

> I ask because PTR_ERR() returns 'long' whereas PTR_RET() returns 'int' (and probe returns 'int'), but I see that the majority of existing code uses "return PTR_ERR()" in probe functions.

    But PTR_RET() uses PTR_ERR() internally anyway.

>>>> +       if (!chipsig) {
>>>> +               dev_err(dev, "unable to map CHIPSIG register\n");
>>>> +               return -EADDRNOTAVAIL;
>>>> +       }

WBR, Sergei

  reply	other threads:[~2013-04-09 13:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1364521307-1219-1-git-send-email-rtivy@ti.com>
     [not found] ` <1364521307-1219-3-git-send-email-rtivy@ti.com>
2013-04-07 12:13   ` [PATCH v9 2/6] remoteproc: Change typo FW_CONFIG to FW_LOADER for REMOTEPROC Ohad Ben-Cohen
     [not found] ` <1364521307-1219-4-git-send-email-rtivy@ti.com>
2013-04-07 12:39   ` [PATCH v9 3/6] remoteproc: Add support to rproc_alloc() for a default firmware name Ohad Ben-Cohen
     [not found] ` <1364521307-1219-2-git-send-email-rtivy@ti.com>
2013-04-07 12:50   ` [PATCH v9 1/6] rpmsg: Process all available messages in virtqueue callback Ohad Ben-Cohen
2013-04-08 22:56     ` Tivy, Robert
2013-04-09  8:25       ` Ohad Ben-Cohen
2013-04-09 20:56         ` Tivy, Robert
2013-04-15  6:11           ` Ohad Ben-Cohen
     [not found] ` <1364521307-1219-5-git-send-email-rtivy@ti.com>
2013-04-07 13:02   ` [PATCH v9 4/6] ARM: davinci: Add a remoteproc driver implementation for OMAP-L13x DSP Ohad Ben-Cohen
2013-04-07 17:55     ` Sergei Shtylyov
2013-04-08 23:55       ` Tivy, Robert
2013-04-09 13:49         ` Sergei Shtylyov [this message]
2013-04-08 22:02     ` Tivy, Robert
2013-04-09  9:03       ` Ohad Ben-Cohen
2013-04-07 13:07 ` [PATCH v9 0/6] ARM: davinci: remoteproc support Ohad Ben-Cohen
2013-04-08  8:08   ` Sekhar Nori

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=51641C4E.5010800@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=linux-arm-kernel@lists.infradead.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.