Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1445715 > unrolled thread
| Started by | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| First post | 2016-07-18 20:50 +0200 |
| Last post | 2016-07-19 18:00 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v1] ESIA : Dummy eisa_driver_register should return error code Arvind Yadav <arvind.yadav.cs@gmail.com> - 2016-07-18 20:50 +0200
Re: [PATCH v1] ESIA : Dummy eisa_driver_register should return error code Christoph Hellwig <hch@infradead.org> - 2016-07-19 06:40 +0200
Re: [PATCH v1] ESIA : Dummy eisa_driver_register should return error code arvind Yadav <arvind.yadav.cs@gmail.com> - 2016-07-19 18:00 +0200
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2016-07-18 20:50 +0200 |
| Subject | [PATCH v1] ESIA : Dummy eisa_driver_register should return error code |
| Message-ID | <rWlM6-1sH-33@gated-at.bofh.it> |
The inline eisa_driver_register stub simply allows compilation on
systems with CONFIG_EISA disabled. the dummy eisa_driver_register
does not register an *_eisa_driver at all. The inline
eisa_driver_register should return to indicate lack of support
when attempting to register an *_eisa_driver on such a system with
CONFIG_EISA disabled.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
include/linux/eisa.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/linux/eisa.h b/include/linux/eisa.h
index 6925249..cbfc684 100644
--- a/include/linux/eisa.h
+++ b/include/linux/eisa.h
@@ -70,7 +70,10 @@ void eisa_driver_unregister (struct eisa_driver *edrv);
#else /* !CONFIG_EISA */
-static inline int eisa_driver_register (struct eisa_driver *edrv) { return 0; }
+static inline int eisa_driver_register(struct eisa_driver *edrv)
+{
+ return -ENODEV;
+}
static inline void eisa_driver_unregister (struct eisa_driver *edrv) { }
#endif /* !CONFIG_EISA */
--
1.9.1
[toc] | [next] | [standalone]
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Date | 2016-07-19 06:40 +0200 |
| Subject | Re: [PATCH v1] ESIA : Dummy eisa_driver_register should return error code |
| Message-ID | <rWuZ3-7HB-1@gated-at.bofh.it> |
| In reply to | #1445715 |
On Tue, Jul 19, 2016 at 12:15:01AM +0530, Arvind Yadav wrote: > The inline eisa_driver_register stub simply allows compilation on > systems with CONFIG_EISA disabled. the dummy eisa_driver_register > does not register an *_eisa_driver at all. The inline > eisa_driver_register should return to indicate lack of support > when attempting to register an *_eisa_driver on such a system with > CONFIG_EISA disabled. Why? The idea is that you can simply leave the stub in if registering say PCI / EISA. With your change such a driver will fail to load even if it could serve PCI device in a !CONFIG_EISA config, which is the behavior we want.
[toc] | [prev] | [next] | [standalone]
| From | arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2016-07-19 18:00 +0200 |
| Subject | Re: [PATCH v1] ESIA : Dummy eisa_driver_register should return error code |
| Message-ID | <rWFB9-5U4-37@gated-at.bofh.it> |
| In reply to | #1446015 |
SCSI_AHA1740 : This is support for a SCSI host adapter.
If CONFIG_EISA is disable then we should not register eisa driver.
static __init int aha1740_init (void)
{
return eisa_driver_register (&aha1740_driver);
}
static __exit void aha1740_exit (void)
{
eisa_driver_unregister (&aha1740_driver);
}
module_init (aha1740_init);
module_exit (aha1740_exit);
----------------------------------------
-Shall we add check by using CONFIG_EISA. We can avoid to register a dummy
driver.
static __init int aha1740_init (void)
{
int err = 0;
#ifdef CONFIG_EISA
err = eisa_driver_register (&aha1740_driver);
#endif
return err;
}
static __exit void aha1740_exit (void)
{
#ifdef CONFIG_EISA
eisa_driver_unregister (&aha1740_driver);
#endif
}
On Tuesday 19 July 2016 10:01 AM, Christoph Hellwig wrote:
> On Tue, Jul 19, 2016 at 12:15:01AM +0530, Arvind Yadav wrote:
>> The inline eisa_driver_register stub simply allows compilation on
>> systems with CONFIG_EISA disabled. the dummy eisa_driver_register
>> does not register an *_eisa_driver at all. The inline
>> eisa_driver_register should return to indicate lack of support
>> when attempting to register an *_eisa_driver on such a system with
>> CONFIG_EISA disabled.
> Why? The idea is that you can simply leave the stub in if registering
> say PCI / EISA. With your change such a driver will fail to load even
> if it could serve PCI device in a !CONFIG_EISA config, which is the
> behavior we want.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web