[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGb2v65T4jqvrW=ZX3fcEm22rU0DEgsRJ2NtXDQ2406Ou5G9MA@mail.gmail.com>
Date: Mon, 9 Dec 2013 23:45:13 +0800
From: Chen-Yu Tsai <wens@...e.org>
To: linux-sunxi <linux-sunxi@...glegroups.com>
Cc: srinivas kandagatla <srinivas.kandagatla@...com>,
devicetree <devicetree@...r.kernel.org>,
netdev <netdev@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Rob Herring <rob.herring@...xeda.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Maxime Ripard <maxime.ripard@...e-electrons.com>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [linux-sunxi] Re: [PATCH 04/10] net: stmmac: sunxi platfrom
extensions for GMAC in Allwinner A20 SoC's
Hi,
On Mon, Dec 9, 2013 at 9:44 PM, Sergei Shtylyov
<sergei.shtylyov@...entembedded.com> wrote:
> Hello.
>
>
> On 09-12-2013 15:21, srinivas kandagatla wrote:
>
>>> +static int sun7i_gmac_init(struct platform_device *pdev)
>>> +{
>>> + struct resource *res;
>>> + struct device *dev = &pdev->dev;
>>> + void __iomem *addr = NULL;
>>> + struct plat_stmmacenet_data *plat_dat = NULL;
>
>
> No need to initialize it since you're assigning to it right below.
>
>
>>> + u32 priv_clk_reg;
>>> +
>>> + plat_dat = dev_get_platdata(&pdev->dev);
>>> + if (!plat_dat)
>>> + return -EINVAL;
>
>
>> dev_get_platdata will return NULL for DT, So this function will fail all
>> the time.
>
>
> Indeed, unless the probe() method assigns it from the 'data' field of
> 'struct of_device_id'.
>
>
>> How is it supposed to work?
>> Am I missing some thing?
>
>
> Look at stmmac_pltfr_probe().
Actually, Srinivas is right.
The platform data assigned from the 'data field' is not the same one as
dev_get_platdata().
This is something I missed when I was reworking the patches.
ChenYu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists