All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Bastian Hecht <hechtb@googlemail.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-sh@vger.kernel.org, linux-mmc@vger.kernel.org,
	Bastian Hecht <hechtb@gmail.com>
Subject: Re: [PATCH] mmc: sh_mobile_sdhi: add a callback for board specific init code
Date: Fri, 16 Mar 2012 12:21:50 -0400	[thread overview]
Message-ID: <87haxobjoh.fsf@laptop.org> (raw)
In-Reply-To: <1331913438-3161-1-git-send-email-hechtb@gmail.com> (Bastian Hecht's message of "Fri, 16 Mar 2012 16:57:18 +0100")

Hi,

On Fri, Mar 16 2012, Bastian Hecht wrote:
> Some boards need a preliminary setup stage to prepare the sdhi
> controller.
>
> Signed-off-by: Bastian Hecht <hechtb@gmail.com>
> ---
>  drivers/mmc/host/sh_mobile_sdhi.c  |   13 +++++++++++++
>  include/linux/mmc/sh_mobile_sdhi.h |    4 ++++
>  2 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> index 0df69ab..1da31a4 100644
> --- a/drivers/mmc/host/sh_mobile_sdhi.c
> +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> @@ -109,6 +109,12 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
>  	mmc_data = &priv->mmc_data;
>  	p->pdata = mmc_data;
>  
> +	if (p->init) {
> +		ret = p->init(pdev);
> +		if (ret)
> +			goto einit;
> +	}
> +
>  	snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
>  	priv->clk = clk_get(&pdev->dev, clk_name);
>  	if (IS_ERR(priv->clk)) {
> @@ -242,6 +248,9 @@ eprobe:
>  #endif
>  	clk_put(priv->clk);
>  eclkget:
> +	if (p->cleanup)
> +		p->cleanup(pdev);
> +einit:
>  	kfree(priv);
>  	return ret;
>  }
> @@ -269,6 +278,10 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
>  	clk_disable(priv->clk);
>  #endif
>  	clk_put(priv->clk);
> +
> +	if (p->cleanup)
> +		p->cleanup(pdev);
> +
>  	kfree(priv);
>  
>  	return 0;
> diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
> index 86347f6..9cad001 100644
> --- a/include/linux/mmc/sh_mobile_sdhi.h
> +++ b/include/linux/mmc/sh_mobile_sdhi.h
> @@ -22,6 +22,10 @@ struct sh_mobile_sdhi_info {
>  	struct tmio_mmc_data *pdata;
>  	void (*set_pwr)(struct platform_device *pdev, int state);
>  	int (*get_cd)(struct platform_device *pdev);
> +
> +	/* callbacks for board specific setup code */
> +	int (*init)(struct platform_device *pdev);
> +	void (*cleanup)(struct platform_device *pdev);
>  };
>  
>  #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */

Thanks, pushed to mmc-next for 3.4.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

WARNING: multiple messages have this Message-ID (diff)
From: Chris Ball <cjb@laptop.org>
To: Bastian Hecht <hechtb@googlemail.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-sh@vger.kernel.org, linux-mmc@vger.kernel.org,
	Bastian Hecht <hechtb@gmail.com>
Subject: Re: [PATCH] mmc: sh_mobile_sdhi: add a callback for board specific init code
Date: Fri, 16 Mar 2012 16:21:50 +0000	[thread overview]
Message-ID: <87haxobjoh.fsf@laptop.org> (raw)
In-Reply-To: <1331913438-3161-1-git-send-email-hechtb@gmail.com> (Bastian Hecht's message of "Fri, 16 Mar 2012 16:57:18 +0100")

Hi,

On Fri, Mar 16 2012, Bastian Hecht wrote:
> Some boards need a preliminary setup stage to prepare the sdhi
> controller.
>
> Signed-off-by: Bastian Hecht <hechtb@gmail.com>
> ---
>  drivers/mmc/host/sh_mobile_sdhi.c  |   13 +++++++++++++
>  include/linux/mmc/sh_mobile_sdhi.h |    4 ++++
>  2 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> index 0df69ab..1da31a4 100644
> --- a/drivers/mmc/host/sh_mobile_sdhi.c
> +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> @@ -109,6 +109,12 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
>  	mmc_data = &priv->mmc_data;
>  	p->pdata = mmc_data;
>  
> +	if (p->init) {
> +		ret = p->init(pdev);
> +		if (ret)
> +			goto einit;
> +	}
> +
>  	snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
>  	priv->clk = clk_get(&pdev->dev, clk_name);
>  	if (IS_ERR(priv->clk)) {
> @@ -242,6 +248,9 @@ eprobe:
>  #endif
>  	clk_put(priv->clk);
>  eclkget:
> +	if (p->cleanup)
> +		p->cleanup(pdev);
> +einit:
>  	kfree(priv);
>  	return ret;
>  }
> @@ -269,6 +278,10 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
>  	clk_disable(priv->clk);
>  #endif
>  	clk_put(priv->clk);
> +
> +	if (p->cleanup)
> +		p->cleanup(pdev);
> +
>  	kfree(priv);
>  
>  	return 0;
> diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
> index 86347f6..9cad001 100644
> --- a/include/linux/mmc/sh_mobile_sdhi.h
> +++ b/include/linux/mmc/sh_mobile_sdhi.h
> @@ -22,6 +22,10 @@ struct sh_mobile_sdhi_info {
>  	struct tmio_mmc_data *pdata;
>  	void (*set_pwr)(struct platform_device *pdev, int state);
>  	int (*get_cd)(struct platform_device *pdev);
> +
> +	/* callbacks for board specific setup code */
> +	int (*init)(struct platform_device *pdev);
> +	void (*cleanup)(struct platform_device *pdev);
>  };
>  
>  #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */

Thanks, pushed to mmc-next for 3.4.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  reply	other threads:[~2012-03-16 16:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 15:57 [PATCH] mmc: sh_mobile_sdhi: add a callback for board specific init code Bastian Hecht
2012-03-16 15:57 ` Bastian Hecht
2012-03-16 16:21 ` Chris Ball [this message]
2012-03-16 16:21   ` Chris Ball
  -- strict thread matches above, loose matches on Subject: below --
2012-01-06 10:39 Bastian Hecht
2012-01-06 10:39 ` Bastian Hecht

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=87haxobjoh.fsf@laptop.org \
    --to=cjb@laptop.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=hechtb@gmail.com \
    --cc=hechtb@googlemail.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.