netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Willy Tarreau <w@1wt.eu>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Gregory Clement <gregory.clement@free-electrons.com>,
	Lior Amsalem <alior@marvell.com>,
	Tawfik Bayouk <tawfik@marvell.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Subject: Re: [PATCH v2 7/9] net: mvmdio: Use devm_* API to simplify the code
Date: Tue, 06 May 2014 22:01:10 +0400	[thread overview]
Message-ID: <53692366.4000600@cogentembedded.com> (raw)
In-Reply-To: <1399396858-14551-8-git-send-email-ezequiel.garcia@free-electrons.com>

Hello.

On 05/06/2014 09:20 PM, Ezequiel Garcia wrote:

> This commit makes use of devm_kmalloc() for memory allocation and the
> recently introduced devm_mdiobus_alloc() API to simplify driver's code.
> While here, remove a redundant out of memory error message.

> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
>   drivers/net/ethernet/marvell/mvmdio.c | 18 ++++++------------
>   1 file changed, 6 insertions(+), 12 deletions(-)

> diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
> index b161a52..995e182 100644
> --- a/drivers/net/ethernet/marvell/mvmdio.c
> +++ b/drivers/net/ethernet/marvell/mvmdio.c
[...]
> @@ -208,11 +207,10 @@ static int orion_mdio_probe(struct platform_device *pdev)
>   		 dev_name(&pdev->dev));
>   	bus->parent = &pdev->dev;
>
> -	bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
> -	if (!bus->irq) {
> -		mdiobus_free(bus);
> +	bus->irq = devm_kmalloc(&pdev->dev,
> +				sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);

    I'd rather use devm_kmalloc_array().

WBR, Sergei

  reply	other threads:[~2014-05-06 18:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06 17:20 [PATCH v2 0/9] net: ethernet: marvell: Assorted fixes Ezequiel Garcia
2014-05-06 17:20 ` [PATCH v2 1/9] net: mv643xx_eth: Simplify mv643xx_eth_adjust_link() Ezequiel Garcia
2014-05-06 17:20 ` [PATCH v2 2/9] net: mvneta: Clean-up mvneta_tx_frag_process() Ezequiel Garcia
2014-05-06 17:20 ` [PATCH v2 3/9] net: mvneta: Check tx queue setup error in mvneta_change_mtu() Ezequiel Garcia
2014-05-06 17:20 ` [PATCH v2 4/9] net: mvneta: Clean-up mvneta_init() Ezequiel Garcia
2014-05-06 17:20 ` [PATCH v2 5/9] net: mvneta: Use prepare/commit API to simplify MAC address setting Ezequiel Garcia
2014-05-06 17:20 ` [PATCH v2 6/9] net: mvneta: Change the number of default rx queues to one Ezequiel Garcia
2014-05-06 17:20 ` [PATCH v2 7/9] net: mvmdio: Use devm_* API to simplify the code Ezequiel Garcia
2014-05-06 18:01   ` Sergei Shtylyov [this message]
2014-05-16 23:48     ` Ezequiel Garcia
2014-05-06 17:20 ` [PATCH v2 8/9] net: mvneta: Factorize feature setting Ezequiel Garcia
2014-05-06 17:20 ` [PATCH v2 9/9] net: mvneta: Remove unneeded 'weigth' field Ezequiel Garcia

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=53692366.4000600@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=alior@marvell.com \
    --cc=davem@davemloft.net \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=gregory.clement@free-electrons.com \
    --cc=netdev@vger.kernel.org \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=tawfik@marvell.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=w@1wt.eu \
    /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;
as well as URLs for NNTP newsgroup(s).