From: Arnd Bergmann <arnd@arndb.de>
To: Lars Poeschel <poeschel@lemonage.de>
Cc: Lars Poeschel <larsi@wh2.tu-dresden.de>,
FlorianSchandinat@gmx.de, mathieu.poirier@linaro.org,
linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] video console: add a driver for lcd2s character display
Date: Tue, 20 Nov 2012 16:11:28 +0000 [thread overview]
Message-ID: <201211201611.28646.arnd@arndb.de> (raw)
In-Reply-To: <201211201521.33726.poeschel@lemonage.de>
On Tuesday 20 November 2012, Lars Poeschel wrote:
> >
> > It's better to define the struct consw as a preinitialized
> > 'static const' object, rather than dynamically setting each
> > member.
>
> I could not find a place to store the drivers private data inside the struct
> vc_data. I wanted to have the struct consw inside the drivers private data
> (struct lcd2s_data) to be able to container_of to the drivers private data in
> the consw.con_* functions. This makes it possible to use more than one actual
> lcd2s display with the same driver. Otherwise I have to store the struct
> i2c_client somewhere statically and the driver can control only one display
> and has to forbid to be probed a second time. Or am I wrong somewhere ?
I believe you can only have one device anyway, because of the way you
register using "take_over_console(&data->consw, LCD2S_FIRST, LCD2S_LAST, 1);"
Whichever lcd2s was last registered gets VC 8 and 9. This is not nice, but
I think it's similar to how all the other VC work. They consequently don't
store per-device data at all, but just have global variables for device
specific data. We generally discourage this behaviour for device drivers,
but I woulnd't expect you to change the way that VC works, so you can just
do the same here.
Things would be different if this was a "console" driver rather than a "vc"
driver.
Arnd
next prev parent reply other threads:[~2012-11-20 16:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 12:56 [PATCH] video console: add a driver for lcd2s character display Lars Poeschel
2012-11-20 13:25 ` Arnd Bergmann
2012-11-20 14:21 ` Lars Poeschel
2012-11-20 16:11 ` Arnd Bergmann [this message]
2012-11-22 9:33 ` [PATCH v2] " Lars Poeschel
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=201211201611.28646.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=FlorianSchandinat@gmx.de \
--cc=larsi@wh2.tu-dresden.de \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=poeschel@lemonage.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).