From: Joshua Clayton <stillcompiling@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Zhi Li <lznuaa@gmail.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Robin Gong <b38343@freescale.com>,
Shawn Guo <shawn.guo@linaro.org>,
"Frank.Li@freescale.com" <Frank.Li@freescale.com>,
linux-input@vger.kernel.org
Subject: Re: [PATCH v2 1/3] input: keyboad: imx: add snvs power key driver
Date: Wed, 13 May 2015 12:10:06 -0700 [thread overview]
Message-ID: <2698983.zamV244jo6@jclayton-pc> (raw)
In-Reply-To: <CAHrpEqRKX_oqT9JKc7=m1Okbq1_30GQOwR_nGPn6aALq2D_-Sw@mail.gmail.com>
Hi Frank.
On Wednesday, May 13, 2015 01:27:39 PM Zhi Li wrote:
> On Wed, May 13, 2015 at 11:40 AM, Dmitry Torokhov
>
> <dmitry.torokhov@gmail.com> wrote:
> > Hi Frank,
> >
> >
> >> + pdata->ioaddr = of_iomap(np, 0);
> >> + if (IS_ERR(pdata->ioaddr))
> >> + return PTR_ERR(pdata->ioaddr);
> >
> > Umm, you are still leaking it on error path. Can you try doing:
> > res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > pdata->ioaddr = devm_ioremap_resource(&pdev->dev, res);
> > if (IS_ERR(pdata->ioaddr))
> >
> > return PTR_ERR(pdata->ioaddr);
>
> Thank you for comments.
> but I don't use of_iomap here because the resource is shared with the
> other device.
>
> SNVS included a rtc, a power off, ON/OFF key.
> If I use platform_get_resource and devm_ioremap_resource, rtc driver
> fail to probe.
>
> best regards
> Frank Li
>
The fact that you cannot use of_iomap() seems a clear warning of unsafe
access.
Since it is a shared resource, which you are writing to as well as reading,
perhaps you should set it up for safe access using the regmap API like the
GPR registers.
/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
--
~Joshua Clayton
next prev parent reply other threads:[~2015-05-13 19:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 14:47 [PATCH v2 1/3] input: keyboad: imx: add snvs power key driver Frank.Li
2015-05-13 14:47 ` [PATCH v2 2/3] document: devicetree: input: imx: i.mx snvs power device tree bindings Frank.Li
2015-05-13 14:47 ` [PATCH v2 3/3] arm: dts: imx6sx: enable snvs power key Frank.Li
2015-05-13 16:40 ` [PATCH v2 1/3] input: keyboad: imx: add snvs power key driver Dmitry Torokhov
2015-05-13 18:27 ` Zhi Li
2015-05-13 19:10 ` Joshua Clayton [this message]
2015-05-13 19:27 ` Zhi Li
2015-05-13 19:44 ` Dmitry Torokhov
2015-05-13 19:57 ` Zhi Li
2015-05-13 20:14 ` Dmitry Torokhov
2015-05-13 17:29 ` Stefan Wahren
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=2698983.zamV244jo6@jclayton-pc \
--to=stillcompiling@gmail.com \
--cc=Frank.Li@freescale.com \
--cc=b38343@freescale.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=lznuaa@gmail.com \
--cc=shawn.guo@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox