linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Ryder Lee <ryder.lee@mediatek.com>
Cc: Chaotian Jing <chaotian.jing@mediatek.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] mmc: mediatek: use of_device_get_match_data()
Date: Thu, 19 Apr 2018 15:18:57 +0200	[thread overview]
Message-ID: <CAPDyKFr9O2YiN8KrwqzOA3rzsx6kA8gRO35_G5bpYRMpg8Z73Q@mail.gmail.com> (raw)
In-Reply-To: <e391bcb1abbe5f7ff46973a5713fd7e067b7e9ff.1523347340.git.ryder.lee@mediatek.com>

On 16 April 2018 at 04:33, Ryder Lee <ryder.lee@mediatek.com> wrote:
> The usage of of_device_get_match_data() reduce the code size a bit.
>
> Also, the only way to call msdc_drv_probe() is to match an entry in
> msdc_of_ids[], so of_id cannot be NULL.
>
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/mtk-sd.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index 6457a7d..67e9b57 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -19,6 +19,7 @@
>  #include <linux/ioport.h>
>  #include <linux/irq.h>
>  #include <linux/of_address.h>
> +#include <linux/of_device.h>
>  #include <linux/of_irq.h>
>  #include <linux/of_gpio.h>
>  #include <linux/pinctrl/consumer.h>
> @@ -1808,7 +1809,6 @@ static int msdc_drv_probe(struct platform_device *pdev)
>         struct mmc_host *mmc;
>         struct msdc_host *host;
>         struct resource *res;
> -       const struct of_device_id *of_id;
>         int ret;
>
>         if (!pdev->dev.of_node) {
> @@ -1816,9 +1816,6 @@ static int msdc_drv_probe(struct platform_device *pdev)
>                 return -EINVAL;
>         }
>
> -       of_id = of_match_node(msdc_of_ids, pdev->dev.of_node);
> -       if (!of_id)
> -               return -EINVAL;
>         /* Allocate MMC host for this device */
>         mmc = mmc_alloc_host(sizeof(struct msdc_host), &pdev->dev);
>         if (!mmc)
> @@ -1887,7 +1884,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
>         msdc_of_property_parse(pdev, host);
>
>         host->dev = &pdev->dev;
> -       host->dev_comp = of_id->data;
> +       host->dev_comp = of_device_get_match_data(&pdev->dev);
>         host->mmc = mmc;
>         host->src_clk_freq = clk_get_rate(host->src_clk);
>         /* Set host parameters to mmc */
> --
> 1.9.1
>

  reply	other threads:[~2018-04-19 13:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16  2:32 [PATCH] i2c: mediatek: use of_device_get_match_data() Ryder Lee
2018-04-16  2:33 ` [PATCH] spi: mediatek: Use of_device_get_match_data() Ryder Lee
2018-04-30  7:26   ` Ryder Lee
2018-05-01 20:35     ` Mark Brown
2018-04-16  2:33 ` [PATCH] soc: mediatek: use of_device_get_match_data() Ryder Lee
2018-04-17 14:37   ` Matthias Brugger
2018-04-16  2:33 ` [PATCH] net: " Ryder Lee
2018-04-16 17:43   ` David Miller
2018-04-16  2:33 ` [PATCH] mmc: " Ryder Lee
2018-04-19 13:18   ` Ulf Hansson [this message]
2018-04-16  2:33 ` [PATCH] mtd: nand: mtk: " Ryder Lee
2018-04-16  4:27   ` xiaolei li
2018-04-22 17:27   ` Boris Brezillon
2018-04-16  2:34 ` [PATCH] thermal: mediatek: " Ryder Lee
2018-04-16  2:34 ` [PATCH] media: rc: mtk-cir: " Ryder Lee
2018-04-17  3:58   ` Sean Wang
2018-04-28 13:12 ` [PATCH] i2c: mediatek: " Wolfram Sang

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=CAPDyKFr9O2YiN8KrwqzOA3rzsx6kA8gRO35_G5bpYRMpg8Z73Q@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=chaotian.jing@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ryder.lee@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;
as well as URLs for NNTP newsgroup(s).