All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Härdeman" <david@hardeman.nu>
To: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Jarod Wilson <jarod@wilsonet.com>, <linux-media@vger.kernel.org>
Subject: Re: [PATCH 0/6] rc-core: ir-core to rc-core conversion
Date: Thu, 11 Nov 2010 16:19:44 +0100	[thread overview]
Message-ID: <02f13638ea24016b5b3673b50940a91c@hardeman.nu> (raw)
In-Reply-To: <4CDBF596.6030206@infradead.org>

On Thu, 11 Nov 2010 11:54:30 -0200, Mauro Carvalho Chehab
<mchehab@infradead.org> wrote:
> The bad news is that ir-kbd-i2c also needs the stuff that are inside
> ir.props (e. g., the IR configuration logic). I wrote and just sent 2
> patches to the ML with the fix patches, against my media-tree.git,
> branch staging/for_v2.6.38. For now, only one field
> of props is used, but other fields there are likely needed for the other
> places where this driver is used, like the open/close callbacks,
> allowed_protocols, etc.
> 
> I don't like the idea of just copying all those config stuff into struct
> IR_i2c, and then at struct rc_dev,

Which is the way it is with or without my patch, either a struct
ir_dev_props or a subset of the former members of that struct are in
IR_i2c, same data. And right now you would need to have a mix between
ir_dev_props data and additional ir_dev related data in struct IR_i2c (the
rc map name is outside of ir_dev_props).

Note that the patch *removes* > 200 lines of code (without any loss of
functionality) - and that's because the interface is simplified. Simple is
good.

> and then at struct input_dev.

struct input_dev only gets input_name, input_phys and input_id from struct
rc_dev, and I did it that way because I didn't want to remove all that
information from all drivers (and fill input_dev with generic information
instead). We'll have to readdress that issue once
multi-input-devs-per-rc-dev functionality is implemented.

> It is too much data duplication for no good reason.

And you believe it's an important feature that props used to be a struct
and that you could pass a pointer (and take care of initializing rc_map)
instead of initializing a couple of members in rc_dev directly?

The use of struct ir_dev_props was a truely bizarre interface. For
example: setting the props member was optional, and a ir_input_dev struct
without a props member lacks a driver_type submember. So all codepaths need
to know what the default driver_type is when props is not set. Not to
mention the number of oops reports that linux-media has already seen,
caused by code which didn't check ->props before dereferencing it. That's
of course a bug in code, but it's a bug caused by a non-intuitive
interface.

The new struct is much more straightforward, and your worries about
additional pain caused by not having a struct ir_dev_props did not
materialize in any of the changes I did (see for example
drivers/media/dvb/dvb-usb/dib0700_devices.c which had similar requirements
to struct IR_i2c).

> So, I think we should re-think about your patch 6/7.

What's your suggestion?

> Comments?

Unsurprisingly, I disagree on the whole re-think part :)

-- 
David Härdeman

  reply	other threads:[~2010-11-11 15:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02 20:17 [PATCH 0/6] rc-core: ir-core to rc-core conversion David Härdeman
2010-11-02 20:17 ` [PATCH 1/6] ir-core: convert drivers/media/video/cx88 to ir-core David Härdeman
2010-11-02 20:17 ` [PATCH 2/6] ir-core: remove remaining users of the ir-functions keyhandlers David Härdeman
2010-11-02 20:17 ` [PATCH 3/6] ir-core: more cleanups of ir-functions.c David Härdeman
2010-11-02 20:17 ` [PATCH 4/6] ir-core: merge and rename to rc-core David Härdeman
2010-11-02 20:18 ` [PATCH 5/6] ir-core: make struct rc_dev the primary interface David Härdeman
2010-11-02 20:18 ` [PATCH 6/6] rc-core: convert winbond-cir David Härdeman
2010-11-02 20:26 ` [PATCH 0/6] rc-core: ir-core to rc-core conversion Jarod Wilson
2010-11-10  1:50   ` Mauro Carvalho Chehab
2010-11-10  3:25     ` Jarod Wilson
2010-11-10  4:33       ` Mauro Carvalho Chehab
2010-11-10  9:28       ` David Härdeman
2010-11-10  9:24     ` David Härdeman
2010-11-10 12:49       ` Mauro Carvalho Chehab
2010-11-10 13:06         ` David Härdeman
2010-11-10 16:24           ` Mauro Carvalho Chehab
2010-11-10 22:01             ` David Härdeman
2010-11-11 13:54               ` Mauro Carvalho Chehab
2010-11-11 15:19                 ` David Härdeman [this message]
2010-11-11 16:00                   ` Mauro Carvalho Chehab
2010-11-11 20:35                     ` David Härdeman
2010-11-11 23:40                       ` Jarod Wilson
2010-11-12  4:00                         ` Mauro Carvalho Chehab
2010-11-12 12:12                           ` David Härdeman
2010-11-12 12:56                             ` Mauro Carvalho Chehab
2010-11-12 14:08                               ` David Härdeman
2010-11-12 14:15                                 ` Mauro Carvalho Chehab
2010-11-12 12:03                         ` David Härdeman
2010-11-11 14:06               ` Mauro Carvalho Chehab
2010-11-09 10:27 ` David Härdeman
2010-11-09 10:34   ` Mauro Carvalho Chehab

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=02f13638ea24016b5b3673b50940a91c@hardeman.nu \
    --to=david@hardeman.nu \
    --cc=jarod@wilsonet.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.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.