All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org
Subject: Re: [PATCH 2/4] rtc: pl031: use devm_* for allocating memory and mapping resource
Date: Thu, 10 Aug 2017 23:05:18 +0200	[thread overview]
Message-ID: <20170810210518.wsmf5jt7fkks7g6y@piout.net> (raw)
In-Reply-To: <E1dYKiF-0001kS-1w@rmk-PC.armlinux.org.uk>

Hi Russell,

On 21/07/2017 at 00:18:31 +0100, Russell King wrote:
> Use the devm_* APIs for allocating memory and mapping the memory in
> the probe function to relieve the driver from having to deal with
> this in the cleanup paths.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/rtc/rtc-pl031.c | 19 +++++++------------
>  1 file changed, 7 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
> index 0d87b90b1903..5960fbd08b05 100644
> --- a/drivers/rtc/rtc-pl031.c
> +++ b/drivers/rtc/rtc-pl031.c
> @@ -310,8 +310,6 @@ static int pl031_remove(struct amba_device *adev)
>  	device_init_wakeup(&adev->dev, false);
>  	free_irq(adev->irq[0], ldata);
>  	rtc_device_unregister(ldata->rtc);
> -	iounmap(ldata->base);
> -	kfree(ldata);
>  	amba_release_regions(adev);
>  
>  	return 0;
> @@ -322,25 +320,26 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
>  	int ret;
>  	struct pl031_local *ldata;
>  	struct pl031_vendor_data *vendor = id->data;
> -	struct rtc_class_ops *ops = &vendor->ops;
> +	struct rtc_class_ops *ops;

This change should probably go in patch 3/4


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: alexandre.belloni@free-electrons.com (Alexandre Belloni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] rtc: pl031: use devm_* for allocating memory and mapping resource
Date: Thu, 10 Aug 2017 23:05:18 +0200	[thread overview]
Message-ID: <20170810210518.wsmf5jt7fkks7g6y@piout.net> (raw)
In-Reply-To: <E1dYKiF-0001kS-1w@rmk-PC.armlinux.org.uk>

Hi Russell,

On 21/07/2017 at 00:18:31 +0100, Russell King wrote:
> Use the devm_* APIs for allocating memory and mapping the memory in
> the probe function to relieve the driver from having to deal with
> this in the cleanup paths.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/rtc/rtc-pl031.c | 19 +++++++------------
>  1 file changed, 7 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
> index 0d87b90b1903..5960fbd08b05 100644
> --- a/drivers/rtc/rtc-pl031.c
> +++ b/drivers/rtc/rtc-pl031.c
> @@ -310,8 +310,6 @@ static int pl031_remove(struct amba_device *adev)
>  	device_init_wakeup(&adev->dev, false);
>  	free_irq(adev->irq[0], ldata);
>  	rtc_device_unregister(ldata->rtc);
> -	iounmap(ldata->base);
> -	kfree(ldata);
>  	amba_release_regions(adev);
>  
>  	return 0;
> @@ -322,25 +320,26 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
>  	int ret;
>  	struct pl031_local *ldata;
>  	struct pl031_vendor_data *vendor = id->data;
> -	struct rtc_class_ops *ops = &vendor->ops;
> +	struct rtc_class_ops *ops;

This change should probably go in patch 3/4


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  parent reply	other threads:[~2017-08-10 21:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 23:17 [PATCH 0/4] Make PL031 interrupt optional Russell King - ARM Linux
2017-07-20 23:17 ` Russell King - ARM Linux
2017-07-20 23:18 ` [PATCH 1/4] rtc: pl031: constify amba_ids Russell King
2017-07-20 23:18   ` Russell King
2017-08-02 12:30   ` Linus Walleij
2017-08-02 12:30     ` Linus Walleij
2017-07-20 23:18 ` [PATCH 2/4] rtc: pl031: use devm_* for allocating memory and mapping resource Russell King
2017-07-20 23:18   ` Russell King
2017-08-02 12:31   ` Linus Walleij
2017-08-02 12:31     ` Linus Walleij
2017-08-10 21:05   ` Alexandre Belloni [this message]
2017-08-10 21:05     ` Alexandre Belloni
2017-07-20 23:18 ` [PATCH 3/4] rtc: pl031: avoid exposing alarm if no interrupt Russell King
2017-07-20 23:18   ` Russell King
2017-08-02 12:32   ` Linus Walleij
2017-08-02 12:32     ` Linus Walleij
2017-07-20 23:18 ` [PATCH 4/4] rtc: pl031: make interrupt optional Russell King
2017-07-20 23:18   ` Russell King
2017-08-02 12:33   ` Linus Walleij
2017-08-02 12:33     ` 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=20170810210518.wsmf5jt7fkks7g6y@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    /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.