All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@st.com>
To: Stefan Roese <sr@denx.de>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"devicetree-discuss@ozlabs.org" <devicetree-discuss@ozlabs.org>,
	spear-devel <spear-devel@list.st.com>, Greg KH <greg@kroah.com>
Subject: Re: [PATCH v2] staging:iio:adc: Add SPEAr ADC driver
Date: Thu, 12 Apr 2012 14:10:15 +0530	[thread overview]
Message-ID: <4F8694EF.6080907@st.com> (raw)
In-Reply-To: <1334219819-2260-1-git-send-email-sr@denx.de>

On 4/12/2012 2:06 PM, Stefan Roese wrote:
> +static int __devinit spear_adc_probe(struct platform_device *pdev)
> +{
> +       struct device_node *np = pdev->dev.of_node;
> +       struct spear_adc_info *info;
> +       struct iio_dev *iodev = NULL;
> +       int ret = -ENODEV;
> +       int irq;
> +
> +       iodev = iio_allocate_device(sizeof(struct spear_adc_info));
> +       if (!iodev) {
> +               dev_err(&pdev->dev, "failed allocating iio device\n");
> +               ret = -ENOMEM;
> +               goto errout1;
> +       }
> +
> +       info = iio_priv(iodev);
> +       info->np = np;
> +
> +       /*
> +        * SPEAr600 has a different register layout than other SPEAr SoC's
> +        * (e.g. SPEAr3xx). Let's provide two register base addresses
> +        * to support multi-arch kernels.
> +        */
> +       info->adc_base_spear6xx = of_iomap(np, 0);
> +       if (!info->adc_base_spear6xx) {
> +               dev_err(&pdev->dev, "failed mapping memory\n");
> +               ret = -ENOMEM;
> +               goto errout2;
> +       }
> +       info->adc_base_spear3xx =
> +               (struct adc_regs_spear3xx *)info->adc_base_spear6xx;
> +
> +       info->clk = clk_get(&pdev->dev, NULL);
> +       if (IS_ERR(info->clk)) {
> +               dev_err(&pdev->dev, "failed getting clock\n");
> +               goto errout3;
> +       }
> +
> +       ret = clk_prepare(info->clk);
> +       if (ret) {
> +               dev_err(&pdev->dev, "failed preparing clock\n");
> +               goto errout3;
> +       }
> +
> +       ret = clk_enable(info->clk);
> +       if (ret) {
> +               dev_err(&pdev->dev, "failed enabling clock\n");
> +               goto errout3;
> +       }
> +
> +       irq = platform_get_irq(pdev, 0);
> +       if ((irq < 0) || (irq >= NR_IRQS)) {
> +               dev_err(&pdev->dev, "failed getting interrupt resource\n");
> +               ret = -EINVAL;
> +               goto errout4;
> +       }
> +
> +       ret = request_irq(irq, spear_adc_isr, 0, MOD_NAME, info);

devm_ ??

Otherwise: 

Acked-by: Viresh Kumar <viresh.kumar@st.com>

WARNING: multiple messages have this Message-ID (diff)
From: Viresh Kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>
To: Stefan Roese <sr-ynQEQJNshbs@public.gmane.org>
Cc: "linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org"
	<devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>,
	spear-devel <spear-devel-nkJGhpqTU55BDgjK7y7TUQ@public.gmane.org>,
	Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v2] staging:iio:adc: Add SPEAr ADC driver
Date: Thu, 12 Apr 2012 14:10:15 +0530	[thread overview]
Message-ID: <4F8694EF.6080907@st.com> (raw)
In-Reply-To: <1334219819-2260-1-git-send-email-sr-ynQEQJNshbs@public.gmane.org>

On 4/12/2012 2:06 PM, Stefan Roese wrote:
> +static int __devinit spear_adc_probe(struct platform_device *pdev)
> +{
> +       struct device_node *np = pdev->dev.of_node;
> +       struct spear_adc_info *info;
> +       struct iio_dev *iodev = NULL;
> +       int ret = -ENODEV;
> +       int irq;
> +
> +       iodev = iio_allocate_device(sizeof(struct spear_adc_info));
> +       if (!iodev) {
> +               dev_err(&pdev->dev, "failed allocating iio device\n");
> +               ret = -ENOMEM;
> +               goto errout1;
> +       }
> +
> +       info = iio_priv(iodev);
> +       info->np = np;
> +
> +       /*
> +        * SPEAr600 has a different register layout than other SPEAr SoC's
> +        * (e.g. SPEAr3xx). Let's provide two register base addresses
> +        * to support multi-arch kernels.
> +        */
> +       info->adc_base_spear6xx = of_iomap(np, 0);
> +       if (!info->adc_base_spear6xx) {
> +               dev_err(&pdev->dev, "failed mapping memory\n");
> +               ret = -ENOMEM;
> +               goto errout2;
> +       }
> +       info->adc_base_spear3xx =
> +               (struct adc_regs_spear3xx *)info->adc_base_spear6xx;
> +
> +       info->clk = clk_get(&pdev->dev, NULL);
> +       if (IS_ERR(info->clk)) {
> +               dev_err(&pdev->dev, "failed getting clock\n");
> +               goto errout3;
> +       }
> +
> +       ret = clk_prepare(info->clk);
> +       if (ret) {
> +               dev_err(&pdev->dev, "failed preparing clock\n");
> +               goto errout3;
> +       }
> +
> +       ret = clk_enable(info->clk);
> +       if (ret) {
> +               dev_err(&pdev->dev, "failed enabling clock\n");
> +               goto errout3;
> +       }
> +
> +       irq = platform_get_irq(pdev, 0);
> +       if ((irq < 0) || (irq >= NR_IRQS)) {
> +               dev_err(&pdev->dev, "failed getting interrupt resource\n");
> +               ret = -EINVAL;
> +               goto errout4;
> +       }
> +
> +       ret = request_irq(irq, spear_adc_isr, 0, MOD_NAME, info);

devm_ ??

Otherwise: 

Acked-by: Viresh Kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>

  reply	other threads:[~2012-04-12  8:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12  8:36 [PATCH v2] staging:iio:adc: Add SPEAr ADC driver Stefan Roese
2012-04-12  8:36 ` Stefan Roese
2012-04-12  8:40 ` Viresh Kumar [this message]
2012-04-12  8:40   ` Viresh Kumar

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=4F8694EF.6080907@st.com \
    --to=viresh.kumar@st.com \
    --cc=devicetree-discuss@ozlabs.org \
    --cc=greg@kroah.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=spear-devel@list.st.com \
    --cc=sr@denx.de \
    /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.