public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jamie Iles <jamie@jamieiles.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: Jamie Iles <jamie@jamieiles.com>,
	linux-kernel@vger.kernel.org, gregkh@suse.de
Subject: Re: [RFC PATCHv3 3/4] drivers/otp: convert bfin otp to generic OTP
Date: Sat, 26 Mar 2011 02:32:52 +0000	[thread overview]
Message-ID: <20110326023252.GZ3130@pulham.picochip.com> (raw)
In-Reply-To: <AANLkTimfjaviwQg5XD9HwtXMOPXq_=N_WOwpQyPf4L_9@mail.gmail.com>

On Fri, Mar 25, 2011 at 10:11:40PM -0400, Mike Frysinger wrote:
> >> > +static const struct otp_region_ops bfin_region_ops = {
> >> > +       .read_word      = bfin_region_read_word,
> >> > +       .write_word     = bfin_region_write_word,
> >> > +       .get_size       = bfin_region_get_size,
> >> > +       .get_fmt        = bfin_region_get_fmt,
> >> > +       .ioctl          = bfin_region_ioctl,
> >> > +};
> >>
> >> hmm, i just realized this stuff is per-region.  wouldnt the
> >> read/write/ioctl make more sense as per-device ?
> >
> > No, I don't think so.  The file_operations are all based on the regions
> > rather than the device so I think it makes sense to have these as region
> > based operations.  We could make them per device and pass the region as
> > a parameter but I'm not sure that it gains us anything.
> 
> for a device that exports more than one region, you dont need to
> duplicate the structure.  as you add in more regions, the amount of
> duplication increases.
> 
> how many regions does your device export ?  does it need different
> read/write behavior for each ?

The current devices are up to 8 regions and whilst the behaviour is the 
same for each it does need to know what region it's operating on so it 
can set the redundancy correctly.

We could move the read and write methods into some device ops but they'd 
need to take an otp_region as a parameter.  Also, at the moment we don't 
duplicate the structure as we're just keeping a pointer to it but I'm 
happy to move these into the device ops if you have a strong preference.

Jamie

  reply	other threads:[~2011-03-26  2:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25 17:14 [RFC PATCHv3 0/4] Support for OTP memory Jamie Iles
2011-03-25 17:14 ` [RFC PATCHv3 1/4] drivers/otp: add initial support " Jamie Iles
2011-03-25 21:58   ` Mike Frysinger
2011-03-25 22:47     ` Jamie Iles
2011-03-25 22:50       ` Mike Frysinger
2011-03-25 22:55         ` Jamie Iles
2011-03-25 22:58           ` Mike Frysinger
2011-03-25 17:14 ` [RFC PATCHv3 2/4] drivers/otp: add support for Picoxcell PC3X3 OTP Jamie Iles
2011-03-25 17:14 ` [RFC PATCHv3 3/4] drivers/otp: convert bfin otp to generic OTP Jamie Iles
2011-03-25 22:56   ` Mike Frysinger
2011-03-26  0:11     ` Jamie Iles
2011-03-26  2:11       ` Mike Frysinger
2011-03-26  2:32         ` Jamie Iles [this message]
2011-03-26  2:55           ` Mike Frysinger
2011-03-25 17:14 ` [RFC PATCHv3 4/4] Blackfin: add the OTP device as a platform device Jamie Iles
2011-03-25 21:37   ` Mike Frysinger

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=20110326023252.GZ3130@pulham.picochip.com \
    --to=jamie@jamieiles.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vapier@gentoo.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