linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: miguel.aguilar@ridgerun.com,
	davinci-linux-open-source@linux.davincidsp.com,
	nsnehaprabha@ti.com, linux-input@vger.kernel.org,
	todd.fischer@ridgerun.com, diego.dompe@ridgerun.com,
	clark.becker@ridgerun.com, santiago.nunez@ridgerun.com
Subject: Re: [PATCH v4 1/2] Input: DaVinci Keypad Driver
Date: Tue, 13 Oct 2009 09:55:24 -0700	[thread overview]
Message-ID: <20091013165524.GA21593@core.coreip.homeip.net> (raw)
In-Reply-To: <BD79186B4FD85F4B8E60E381CAEE190901DB800C@mi8nycmail19.Mi8.com>

On Tue, Oct 13, 2009 at 12:21:47PM -0400, H Hartley Sweeten wrote:
> On Monday, October 12, 2009 10:47 PM, Dmitry Torokhov wrote:
> > Hi Miguel,
> > 
> > On Fri, Oct 09, 2009 at 11:27:05AM -0600, miguel.aguilar@ridgerun.com wrote:
> >> From: Miguel Aguilar <miguel.aguilar@ridgerun.com>
> >> 
> >> Adds the driver for enabling keypad support for DaVinci platforms.
> >> 
> >> DM365 is the only platform that uses this driver at the moment.
> >> 
> >
> > Looks pretty good, I have one question:
> >
> >> +static void davinci_ks_write(struct davinci_ks *davinci_ks, u32 val, u32 addr)
> >> +{
> >> +	u32 base = (u32)davinci_ks->base;
> >> +
> >> +	__raw_writel(val,(u32 *)(base + addr));
> >> +}
> >
> > Do you really need these casts? I'd think that bare __raw_writel would
> > work just fine.
> 
> The address for __raw_{write/read}* should be void __iomem *, davinci_ks->base
> should already be the correct type due to ioremap().
> 
> You can probably just change the whole thing to:
> 
> +static void davinci_ks_write(struct davinci_ks *davinci_ks, u32 val, u32 addr)
> +{
> +	__raw_writel(val, davinci_ks->base + addr);
> +}
> +
> +static u32 davinci_ks_read(struct davinci_ks *davinci_ks, u32 addr)
> +{
> +	return __raw_readl(davinci_ks->base + addr);
> +}
> 

Better yet, use __raw_readl() and __raw_writel() directly - there is no
need for wrappers that just rename existig functions not adding any
additional functionality.

-- 
Dmitry

  reply	other threads:[~2009-10-13 16:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-09 17:27 [PATCH v4 1/2] Input: DaVinci Keypad Driver miguel.aguilar-9uBrGCPFOa1Wk0Htik3J/w
     [not found] ` <1255109225-6833-1-git-send-email-miguel.aguilar-9uBrGCPFOa1Wk0Htik3J/w@public.gmane.org>
2009-10-12 18:27   ` Kevin Hilman
     [not found]     ` <874oq4sc1b.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2009-10-13 18:58       ` Miguel Aguilar
2009-10-13  5:46 ` Dmitry Torokhov
2009-10-13 16:21   ` H Hartley Sweeten
2009-10-13 16:55     ` Dmitry Torokhov [this message]
     [not found]       ` <20091013165524.GA21593-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2009-10-13 17:03         ` Miguel Aguilar
     [not found]   ` <20091013054644.GF2887-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2009-10-13 16:43     ` Miguel Aguilar
     [not found] <1254772537-30836-1-git-send-email-miguel.aguilar@ridgerun.com>
     [not found] ` <4ACF6DBA.8080307@ridgerun.com>
     [not found]   ` <20091009172011.GF1092@core.coreip.homeip.net>
2009-10-09 17:21     ` Dmitry Torokhov

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=20091013165524.GA21593@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=clark.becker@ridgerun.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=diego.dompe@ridgerun.com \
    --cc=hartleys@visionengravers.com \
    --cc=linux-input@vger.kernel.org \
    --cc=miguel.aguilar@ridgerun.com \
    --cc=nsnehaprabha@ti.com \
    --cc=santiago.nunez@ridgerun.com \
    --cc=todd.fischer@ridgerun.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).