public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Cc: linux-kernel@vger.kernel.org,
	davinci-linux-open-source@linux.davincidsp.com,
	akpm@linux-foundation.org
Subject: Re: [PATCH] davinci: MMC: Pass number of SG segments as platform data
Date: Thu, 11 Mar 2010 15:39:24 -0800	[thread overview]
Message-ID: <87wrxia0nn.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1268292756-5369-1-git-send-email-sudhakar.raj@ti.com> (Sudhakar Rajashekhara's message of "Thu\, 11 Mar 2010 13\:02\:36 +0530")

Sudhakar Rajashekhara <sudhakar.raj@ti.com> writes:

> On some platforms like DM355, the number of EDMA parameter
> slots available for EDMA_SLOT_ANY usage are few. In such cases,
> if MMC/SD uses 16 slots for each instance of MMC controller,
> then the number of slots available for other modules will be
> very few.
>
> By passing the number of EDMA slots to be used in MMC driver
> from platform data, EDMA slots available for other purposes
> can be controlled.
>
> Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> ---
>  arch/arm/mach-davinci/include/mach/mmc.h |    3 +++
>  drivers/mmc/host/davinci_mmc.c           |   22 +++++++++++++++-------
>  2 files changed, 18 insertions(+), 7 deletions(-)
>

[...]

> @@ -1202,6 +1206,10 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
>  
>  	init_mmcsd_host(host);
>  
> +	host->nr_sg = pdata->nr_sg - 1;

If a board doesn't setup pdata->nr_sg it will be zero, leaving
host->nr_sg = -1.

> +	if (host->nr_sg > MAX_NR_SG || host->nr_sg == 0)
> +		host->nr_sg = MAX_NR_SG;

Since host->nr_sg is unsigned, you get lucky and fix it up here, but
for readability, this not too clean and should be more thorough.

Wrapping the above in 'if (pdata->nr_sg)' is a more standard way
of handling optional platform_data paramaters.

Kevin

      parent reply	other threads:[~2010-03-11 23:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-11  7:32 [PATCH] davinci: MMC: Pass number of SG segments as platform data Sudhakar Rajashekhara
2010-03-11 11:00 ` Sergei Shtylyov
2010-03-11 23:39 ` Kevin Hilman [this message]

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=87wrxia0nn.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=akpm@linux-foundation.org \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudhakar.raj@ti.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