linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Cc: Ben Dooks <ben-linux@fluff.org>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Sylwester Nawrocki <snawrocki@kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: [PATCH v2 3/3] mmc: sdhci-s3c: constify uses of driver/match data
Date: Thu, 15 Apr 2021 14:02:46 +0200	[thread overview]
Message-ID: <CAPDyKFqngqc9Rc6Efx0bLgoh3zo0siiNBho-A_ZB=O6+yBNR+A@mail.gmail.com> (raw)
In-Reply-To: <20210415084412.51125-3-krzysztof.kozlowski@canonical.com>

On Thu, 15 Apr 2021 at 10:44, Krzysztof Kozlowski
<krzysztof.kozlowski@canonical.com> wrote:
>
> The driver data (struct sdhci_s3c_drv_data) stored in of_device_id
> table is allocated as const and used only in const-way.  Skip
> unnecessary const-away casts and convert all users to work with pointer
> to const.  This is both more logical and safer.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>

Applied for next, thanks!

Kind regards
Uffe


> ---
>
> Changes since v1:
> 1. None
> ---
>  drivers/mmc/host/sdhci-s3c.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index a07a8f011741..862f033d235d 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -462,21 +462,21 @@ static int sdhci_s3c_parse_dt(struct device *dev,
>  }
>  #endif
>
> -static inline struct sdhci_s3c_drv_data *sdhci_s3c_get_driver_data(
> +static inline const struct sdhci_s3c_drv_data *sdhci_s3c_get_driver_data(
>                         struct platform_device *pdev)
>  {
>  #ifdef CONFIG_OF
>         if (pdev->dev.of_node)
> -               return (struct sdhci_s3c_drv_data *)of_device_get_match_data(&pdev->dev);
> +               return of_device_get_match_data(&pdev->dev);
>  #endif
> -       return (struct sdhci_s3c_drv_data *)
> +       return (const struct sdhci_s3c_drv_data *)
>                         platform_get_device_id(pdev)->driver_data;
>  }
>
>  static int sdhci_s3c_probe(struct platform_device *pdev)
>  {
>         struct s3c_sdhci_platdata *pdata;
> -       struct sdhci_s3c_drv_data *drv_data;
> +       const struct sdhci_s3c_drv_data *drv_data;
>         struct device *dev = &pdev->dev;
>         struct sdhci_host *host;
>         struct sdhci_s3c *sc;
> @@ -761,7 +761,7 @@ static const struct platform_device_id sdhci_s3c_driver_ids[] = {
>  MODULE_DEVICE_TABLE(platform, sdhci_s3c_driver_ids);
>
>  #ifdef CONFIG_OF
> -static struct sdhci_s3c_drv_data exynos4_sdhci_drv_data = {
> +static const struct sdhci_s3c_drv_data exynos4_sdhci_drv_data = {
>         .no_divider = true,
>  };
>
> --
> 2.25.1
>

  parent reply	other threads:[~2021-04-15 12:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15  8:44 [PATCH v2 1/3] mmc: sdhci-s3c: simplify getting of_device_id match data Krzysztof Kozlowski
2021-04-15  8:44 ` [PATCH v2 2/3] mmc: sdhci-s3c: correct kerneldoc of sdhci_s3c_drv_data Krzysztof Kozlowski
2021-04-15  9:57   ` Sylwester Nawrocki
2021-04-15 12:02   ` Ulf Hansson
2021-04-15  8:44 ` [PATCH v2 3/3] mmc: sdhci-s3c: constify uses of driver/match data Krzysztof Kozlowski
2021-04-15  9:42   ` Sylwester Nawrocki
2021-04-15 12:02   ` Ulf Hansson [this message]
2021-04-15  9:39 ` [PATCH v2 1/3] mmc: sdhci-s3c: simplify getting of_device_id match data Sylwester Nawrocki
2021-04-15 12:02 ` Ulf Hansson

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='CAPDyKFqngqc9Rc6Efx0bLgoh3zo0siiNBho-A_ZB=O6+yBNR+A@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=ben-linux@fluff.org \
    --cc=jh80.chung@samsung.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=snawrocki@kernel.org \
    /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).