All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier.adi@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: uclinux-dist-devel@blackfin.uclinux.org,
	Michael Hennerich <michael.hennerich@analog.com>,
	linux-input@vger.kernel.org
Subject: Re: [Uclinux-dist-devel] [PATCH v2] Input: ad7879: split bus logic out
Date: Tue, 19 Jan 2010 03:46:20 -0500	[thread overview]
Message-ID: <8bd0f97a1001190046jcb51d1bs6275ef317b43739@mail.gmail.com> (raw)
In-Reply-To: <20100119082652.GA19338@core.coreip.homeip.net>

On Tue, Jan 19, 2010 at 03:26, Dmitry Torokhov wrote:
> On Mon, Jan 18, 2010 at 11:52:44PM -0500, Mike Frysinger wrote:
>>  struct ad7879 {
>> -     bus_device              *bus;
>> +     struct ad7879_bus_ops   bops;
>
> Could you change it to 'const struct ad7879_bus_ops *bops;' and add a
> separate pointer to private transport data so that bus ops are truly
> shared between instances (if any).

i can make the struct containing only the funcs const, but not the
struct that contains the irq/client since i dynamically assign the
contents in the probe func

> Also I dont see the reason for having the following typedefs:

it made sense in the other drivers i copied this format from, and in
an earlier version of the code, but they arent needed anymore, so i'll
drop em

>> +typedef int (ad7879_read_t) (void *bus_data, u8 reg);
>> +typedef int (ad7879_multi_read_t) (void *bus_data, u8 first_reg, u8 count, u16 *buf);
>> +typedef int (ad7879_write_t) (void *bus_data, u8 reg, u16 val);
>> +
>> +struct ad7879_bus_ops {
>> +     void *bus_data;
>> +     int irq;
>> +     ad7879_read_t *read;
>> +     ad7879_multi_read_t *multi_read;
>> +     ad7879_write_t *write;
>> +};
>> +
>> +int ad7879_disable(struct device *dev);
>> +int ad7879_enable(struct device *dev);
>> +int ad7879_probe(struct device *dev, struct ad7879_bus_ops *bops, u8 devid, u16 bustype);
>> +int ad7879_remove(struct device *dev);
>
> Hmm, I liked when these accepted "struct ad7879" better.

i toyed with that a bit, but the generated code was worse because the
drvdata helpers are externals
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-01-19  8:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-17 15:38 [PATCH] Input: ad7879: split bus logic out Mike Frysinger
2010-01-19  4:52 ` [PATCH v2] " Mike Frysinger
2010-01-19  8:26   ` Dmitry Torokhov
2010-01-19  8:46     ` Mike Frysinger [this message]
2010-01-19  8:51       ` [Uclinux-dist-devel] " Dmitry Torokhov
2010-01-19  8:57         ` Mike Frysinger
2010-01-19  8:56     ` [PATCH v3] " Mike Frysinger
2010-05-21  8:10       ` [Uclinux-dist-devel] " 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=8bd0f97a1001190046jcb51d1bs6275ef317b43739@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=uclinux-dist-devel@blackfin.uclinux.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 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.