All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Andrzej Hajda <a.hajda@samsung.com>,
	Tomasz Figa <tomasz.figa@gmail.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH] pinctrl: samsung: Fix memory mapping code
Date: Wed, 22 Feb 2017 08:59:33 +0100	[thread overview]
Message-ID: <b3d7a3f6-d5ea-6a3e-4d9c-91aa5ce49d7c@samsung.com> (raw)
In-Reply-To: <1487749442-23806-1-git-send-email-a.hajda@samsung.com>

Hi,

On 2017-02-22 08:44, Andrzej Hajda wrote:
> Some pinctrls share memory regions, and devm_ioremap_resource does not
> allow to share resources, in opposition to devm_ioremap.
> This patch restores back usage of devm_ioremap function, but with proper
> error handling and logging.
>
> Fixes: baafaca ("pinctrl: samsung: Fix return value check in samsung_pinctrl_get_soc_data()")
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

> ---
>   drivers/pinctrl/samsung/pinctrl-samsung.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
> index f9ddba7..ebecff8 100644
> --- a/drivers/pinctrl/samsung/pinctrl-samsung.c
> +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
> @@ -988,9 +988,12 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d,
>   
>   	for (i = 0; i < ctrl->nr_ext_resources + 1; i++) {
>   		res = platform_get_resource(pdev, IORESOURCE_MEM, i);
> -		virt_base[i] = devm_ioremap_resource(&pdev->dev, res);
> -		if (IS_ERR(virt_base[i]))
> -			return ERR_CAST(virt_base[i]);
> +		virt_base[i] = devm_ioremap(&pdev->dev, res->start,
> +						resource_size(res));
> +		if (!virt_base[i]) {
> +			dev_err(&pdev->dev, "failed to ioremap %pR\n", res);
> +			return ERR_PTR(-EIO);
> +		}
>   	}
>   
>   	bank = d->pin_banks;

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

  reply	other threads:[~2017-02-22  7:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170222074421eucas1p17bbab9c297450bca1c5908ada16d2fa6@eucas1p1.samsung.com>
2017-02-22  7:44 ` [PATCH] pinctrl: samsung: Fix memory mapping code Andrzej Hajda
2017-02-22  7:59   ` Marek Szyprowski [this message]
2017-02-22 17:02   ` Krzysztof Kozlowski
     [not found]     ` <CGME20170223101244eucas1p2eddf13a013d66f9ccdbe45f410b5939c@eucas1p2.samsung.com>
2017-02-23 10:12       ` [PATCH v2] " Andrzej Hajda
2017-02-23 11:37         ` Krzysztof Kozlowski
2017-03-14 13:35         ` Linus Walleij
2017-03-14 14:28           ` Andrzej Hajda
2017-03-15 13:44             ` Linus Walleij
2017-03-15 13:43         ` Linus Walleij

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=b3d7a3f6-d5ea-6a3e-4d9c-91aa5ce49d7c@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=krzk@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=tomasz.figa@gmail.com \
    /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.