From: Sebastian Siewior <al+sa@ml.breakpoint.cc>
To: Takashi Iwai <tiwai@suse.de>
Cc: Jaroslav Kysela <perex@perex.cz>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
dtor@mail.ru, Dmitry Torokhov <dmitry.torokhov@gmail.com>,
ALSA development <alsa-devel@alsa-project.org>,
linux-input@vger.kernel.org
Subject: Re: [alsa-devel] [RFC] ucb1400 touchscreen, irq auto probing and ac97 with its private field
Date: Fri, 25 Apr 2008 14:49:08 +0200 [thread overview]
Message-ID: <20080425124908.GA7152@Chamillionaire.breakpoint.cc> (raw)
In-Reply-To: <s5habjikx5k.wl%tiwai@suse.de>
* Takashi Iwai | 2008-04-25 13:10:31 [+0200]:
>> Why is it a problem to keep an anonymous struct?
>
>You describe in your text below :)
Right :D
>> If some one uses a
>> wrong struct than it crashes immediatelly or bails out because
>> 0x20495251 is way too large be an IRQ. Putting that magic and casting
>> for every single possible data blows code for no good reason. Don't
>> recover from errors which should not have happen, solve them at root
>> level not where the leaves are.
>
>The root level of the problem is that you pass the anonymous data.
>It _IS_ unsafe and wrong unless handled properly.
Yes and this should not happen in my perfect world :)
>
>> What I intended in first place is to allocate a private field in the bus
>> struct so can pass informations to the lower driver.
>
>As mentioned in my earlier mail, I'm fine with your first patch. The
>problem occurs when we generalize it.
Generalize? You mean once you need an array of multiple parameters like
struct ressource where the controler driver and device driver are
independent and don't know each other? In this case I understand why you
prefered the int irq over the void pointer.
>> If you need
>> multiple arguments, create your own struct put it in the void * slot,
>> your driver knows what to do.
>
>Your driver does _not_ know what type it is because the data isn't
>created by your driver but the controller driver. And, it's free to
>attach your driver to any controller.
Sure. But why should the controller attach data that is not desired for
the driver chip? So if the ucb1400 gets probed with private data that is
desired for another driver it will bail out after checking the device
id and nothing happens. In my case the controller knows that there is
ucb1400 touchscreen attached and I can't imagine why the controller
shouldn't know.
>thanks,
>
>Takashi
Sebastian
next prev parent reply other threads:[~2008-04-25 12:49 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-24 14:04 [RFC] ucb1400 touchscreen, irq auto probing and ac97 with its private field Sebastian Siewior
2008-04-24 14:32 ` Jaroslav Kysela
2008-04-24 14:35 ` Sebastian Siewior
2008-04-24 14:57 ` Mark Brown
2008-04-24 15:02 ` [alsa-devel] " Mark Brown
2008-04-24 15:44 ` Sebastian Siewior
2008-04-24 21:33 ` [alsa-devel] " Mark Brown
2008-04-24 15:35 ` Sebastian Siewior
2008-04-24 20:04 ` Mark Brown
2008-04-24 16:09 ` [alsa-devel] " Takashi Iwai
2008-04-24 18:56 ` Mark Brown
2008-04-25 7:02 ` Takashi Iwai
2008-04-25 7:10 ` [alsa-devel] " Jaroslav Kysela
2008-04-25 7:18 ` Takashi Iwai
2008-04-25 7:35 ` Jaroslav Kysela
2008-04-25 7:46 ` Sebastian Siewior
2008-04-25 7:52 ` Takashi Iwai
2008-04-25 8:23 ` Jaroslav Kysela
2008-04-25 9:17 ` Takashi Iwai
2008-04-25 9:45 ` [alsa-devel] " Jaroslav Kysela
2008-04-25 10:05 ` Takashi Iwai
2008-04-25 10:18 ` Jaroslav Kysela
2008-04-25 10:54 ` Sebastian Siewior
2008-04-25 11:10 ` Takashi Iwai
2008-04-25 11:22 ` [alsa-devel] " Jaroslav Kysela
2008-04-25 13:04 ` Takashi Iwai
2008-04-25 12:49 ` Sebastian Siewior [this message]
2008-04-25 13:01 ` Takashi Iwai
2008-04-25 15:31 ` Dmitry Torokhov
2008-04-25 9:51 ` Mark Brown
2008-04-25 10:15 ` Takashi Iwai
2008-04-25 10:20 ` Jaroslav Kysela
2008-04-25 10:28 ` [alsa-devel] " Mark Brown
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=20080425124908.GA7152@Chamillionaire.breakpoint.cc \
--to=al+sa@ml.breakpoint.cc \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dmitry.torokhov@gmail.com \
--cc=dtor@mail.ru \
--cc=linux-input@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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).