From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Cc: dwmw2@infradead.org, computersforpeace@gmail.com,
matthias.bgg@gmail.com, robh@kernel.org,
linux-mtd@lists.infradead.org, xiaolei.li@mediatek.com,
daniel.thompson@linaro.org, erin.lo@mediatek.com,
linux-mediatek@lists.infradead.org
Subject: Re: [RFCv2: PATCH 2/2] mtd: mediatek: driver for MTK Smart Device Gen1 NAND
Date: Wed, 23 Mar 2016 09:26:15 +0100 [thread overview]
Message-ID: <20160323092615.1450363a@bbrezillon> (raw)
In-Reply-To: <56F1E378.3000107@linaro.org>
On Tue, 22 Mar 2016 20:29:44 -0400
Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> wrote:
> On 03/22/2016 12:58 PM, Boris Brezillon wrote:
> >> +
> >> > +static struct sdg1_ecc_if *sdg1_ecc_get(struct device_node *np)
> >> > +{
> >> > + struct platform_device *pdev;
> >> > + struct sdg1_ecc *ecc;
> >> > +
> >> > + pdev = of_find_device_by_node(np);
> >> > + if (!pdev || !platform_get_drvdata(pdev))
> >> > + return ERR_PTR(-EPROBE_DEFER);
> >> > +
> >> > + get_device(&pdev->dev);
> >> > + ecc = platform_get_drvdata(pdev);
> >> > +
> >> > + clk_prepare_enable(ecc->clk);
> >> > + ecc->dev = &pdev->dev;
> > ecc->dev should be assigned in ->probe().
> >
>
> fyi this was just copied verbatim from
Yep, I noticed the jz4780 driver was doing the same. Maybe you can send
a patch to fix it (in general, dev <-> priv data association is done at
proble time).
>
> static struct jz4780_bch *jz4780_bch_get(struct device_node *np)
> {
> struct platform_device *pdev;
> struct jz4780_bch *bch;
>
> pdev = of_find_device_by_node(np);
> if (!pdev || !platform_get_drvdata(pdev))
> return ERR_PTR(-EPROBE_DEFER);
>
> get_device(&pdev->dev);
>
> bch = platform_get_drvdata(pdev);
> clk_prepare_enable(bch->clk);
>
> bch->dev = &pdev->dev;
> return bch;
> }
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-03-23 8:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 13:32 [RFCv2 0/2] MTK Smart Device Gen1 NAND Driver Jorge Ramirez-Ortiz
2016-03-22 13:32 ` [RFCv2: PATCH 1/2] mtd: mediatek: device tree docs for MTK Smart Device Gen1 NAND Jorge Ramirez-Ortiz
2016-03-22 13:52 ` Boris Brezillon
2016-03-26 18:38 ` Jorge Ramirez-Ortiz
2016-03-29 7:58 ` Boris Brezillon
2016-03-31 12:41 ` Jorge Ramirez-Ortiz
2016-03-22 13:32 ` [RFCv2: PATCH 2/2] mtd: mediatek: driver " Jorge Ramirez-Ortiz
2016-03-22 16:58 ` Boris Brezillon
2016-03-22 23:43 ` Jorge Ramirez-Ortiz
2016-03-23 8:41 ` Boris Brezillon
2016-03-23 12:44 ` Jorge Ramirez-Ortiz
2016-03-23 0:29 ` Jorge Ramirez-Ortiz
2016-03-23 8:26 ` Boris Brezillon [this message]
2016-03-22 13:47 ` [RFCv2 0/2] MTK Smart Device Gen1 NAND Driver Boris Brezillon
2016-03-22 14:08 ` Jorge Ramirez-Ortiz
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=20160323092615.1450363a@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=daniel.thompson@linaro.org \
--cc=dwmw2@infradead.org \
--cc=erin.lo@mediatek.com \
--cc=jorge.ramirez-ortiz@linaro.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robh@kernel.org \
--cc=xiaolei.li@mediatek.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