RE: [PATCH 30/90] staging: comedi: amplc_dio200: store the pci_devin the comedi_device

From: H Hartley Sweeten
Date: Thu Jul 19 2012 - 13:14:34 EST


On Thursday, July 19, 2012 3:11 AM, Ian Abbott wrote:
> On 2012-07-19 02:37, H Hartley Sweeten wrote:
>> Use the hw_dev pointer in the comedi_device struct to hold the
>> pci_dev instead of carrying it in the private data.
>>
>> Since the pci_dev is no longer held in the provate data, we can
>> also cleanup the detach a bit. Remove the IS_ENABLED() tests in
>> the detach. If the pci_dev is non NULL it's a PCI device otherwise
>> it's an ISA device. Using IS_ENABLED() to omit the code paths
>> makes the code a bit confusing and doesn't save much.
>
> No, you really need to check thisboard->bustype in the detach() because
> hw_dev might be NULL for a PCI board if the attach() failed.

Ah, overlooked that.

I still think the IS_ENABLED() stuff should be removed where possible. It
just looks confusing in the if().

Regards,
Hartley

N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i