From: Ian Abbott <abbotti@mev.co.uk>
To: Chase Southwood <chase.southwood@gmail.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
<hsweeten@visionengravers.com>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] staging: comedi: addi_apci_1564: use addi_watchdog module to init watchdog subdevice
Date: Tue, 15 Jul 2014 11:14:51 +0100 [thread overview]
Message-ID: <53C4FF1B.3080409@mev.co.uk> (raw)
In-Reply-To: <CA+jnaaVm9_S1=aVCoq_corBvUHDDz2LC3zSLD_D2PsSbGy_avg@mail.gmail.com>
On 2014-07-15 05:00, Chase Southwood wrote:
> On Mon, Jul 14, 2014 at 4:22 AM, Ian Abbott <abbotti@mev.co.uk> wrote:
>> On 2014-07-12 23:44, Chase Southwood wrote:
>>>
>>> Use the addi_watchdog module to provide support for the watchdog
>>> subdevice.
>>>
>>> Also, rearrange the subdevice init blocks so that the order makes sense.
>>> Digital input/output subdevices and subdevices for DI/DO interrupt
>>> support, followed by timer/counter/watchdog subdevices is the new order.
>>>
>>> Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
>>> Cc: Ian Abbott <abbotti@mev.co.uk>
>>> Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
>>> ---
>>> drivers/staging/comedi/drivers/addi_apci_1564.c | 34
>>> +++++++++++++++----------
>>> 1 file changed, 20 insertions(+), 14 deletions(-)
>>
>>
>> I don't think the subdevice order matters that much, and I prefer to keep
>> them stable, but since this driver is in such a state of flux, it doesn't
>> really matter.
>>
>
> Hi Ian!
> Quick question here about this. First off, duly noted that grouping
> subdevices by function isn't necessary and I won't shuffle them around
> like this in the future. Second, the reason I stuck the watchdog at
> the end is because it causes an early return if addi_watchdog_init()
> returns an error and it seemed appropriate at the end so it doesn't
> prevent the initialization of any other subdevices if that call should
> fail. Now I realize that it is very unlikely that that call fails,
> but in any case should I put future subdevice inits above the watchdog
> for the same reason (so they aren't at risk of not getting
> initialized), or does that count for subdevice order not being stable
> and you would prefer them all to go at the end?
Since you return an error from the auto_attach handler
apci1564_auto_attach() when addi_watchdog_init() fails, it makes little
difference what order the subdevices are initialized in. The error from
auto_attach handler causes the comedi core to call the detach handler
apci1564_detach() and tear everything down. Ultimately,
comedi_pci_auto_attach() will return an error back to the PCI probe
function apci1564_pci_probe(), which will propagate it to the PCI subsystem.
In general, if adding a new subdevice, either add it to the end or
replace an "unused" subdevice.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
next prev parent reply other threads:[~2014-07-15 10:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-12 22:42 [PATCH 1/2] staging: comedi: addi_apci_1564: driver no longer needs to include addi_common.h Chase Southwood
2014-07-12 22:44 ` [PATCH 2/2] staging: comedi: addi_apci_1564: use addi_watchdog module to init watchdog subdevice Chase Southwood
2014-07-13 19:17 ` Hartley Sweeten
2014-07-14 3:09 ` Chase Southwood
2014-07-14 9:22 ` Ian Abbott
2014-07-15 4:00 ` Chase Southwood
2014-07-15 10:14 ` Ian Abbott [this message]
2014-07-17 2:35 ` Chase Southwood
2014-07-14 9:15 ` [PATCH 1/2] staging: comedi: addi_apci_1564: driver no longer needs to include addi_common.h Ian Abbott
2014-07-14 9:23 ` Ian Abbott
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=53C4FF1B.3080409@mev.co.uk \
--to=abbotti@mev.co.uk \
--cc=chase.southwood@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=linux-kernel@vger.kernel.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
Powered by JetHome