netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: madalin.bucur@nxp.com
Cc: netdev@vger.kernel.org, f.fainelli@gmail.com, andrew@lunn.ch,
	vivien.didelot@savoirfairelinux.com, junote@outlook.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] dpaa_eth: change device used
Date: Wed, 11 Oct 2017 14:02:03 -0700 (PDT)	[thread overview]
Message-ID: <20171011.140203.578840078366210432.davem@davemloft.net> (raw)
In-Reply-To: <1507644618-32006-4-git-send-email-madalin.bucur@nxp.com>

From: Madalin Bucur <madalin.bucur@nxp.com>
Date: Tue, 10 Oct 2017 17:10:17 +0300

> @@ -2696,7 +2681,13 @@ static int dpaa_eth_probe(struct platform_device *pdev)
>  	int err = 0, i, channel;
>  	struct device *dev;
>  
> -	dev = &pdev->dev;
> +	/* device used for DMA mapping */
> +	dev = pdev->dev.parent;
> +	err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(40));
> +	if (err) {
> +		dev_err(dev, "dma_coerce_mask_and_coherent() failed\n");
> +		goto dev_mask_failed;
> +	}
>  
>  	/* Allocate this early, so we can store relevant information in
>  	 * the private area

Since you are moving this code up before the netdev allocation, you must
adjust the failure path goto label used.

Your change as-is will cause an OOPS because we'll pass a NULL pointer
to free_netdev().

  reply	other threads:[~2017-10-11 21:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 14:10 [PATCH 0/4] adapt DPAA drivers for DSA Madalin Bucur
2017-10-10 14:10 ` [PATCH 1/4] fsl/fman: remove of_node Madalin Bucur
2017-10-10 14:10 ` [PATCH 2/4] dpaa_eth: move of_phy_connect() to the eth driver Madalin Bucur
2017-10-10 14:10 ` [PATCH 3/4] dpaa_eth: change device used Madalin Bucur
2017-10-11 21:02   ` David Miller [this message]
2017-10-12  9:11     ` Madalin-cristian Bucur
2017-10-10 14:10 ` [PATCH 4/4] fsl/fman: add dpaa in module names Madalin Bucur

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=20171011.140203.578840078366210432.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=junote@outlook.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.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 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).