From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Lidza Louina <lidza.louina@gmail.com>,
Mark Hounschell <markh@compro.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
driverdev-devel@linuxdriverproject.org,
devel@driverdev.osuosl.org,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH 3/4] staging: dgnc: unregister pci driver
Date: Sat, 27 Feb 2016 17:33:34 +0530 [thread overview]
Message-ID: <1456574615-32003-3-git-send-email-sudipm.mukherjee@gmail.com> (raw)
In-Reply-To: <1456574615-32003-1-git-send-email-sudipm.mukherjee@gmail.com>
We may choose to load the module without the hardware present. That will
register the pci driver but since probe will not succeed so
dgnc_NumBoards will be 0. Now if we unload the module then the pci
driver stays registered as dgnc_NumBoards is 0. And if we try to load
the module again it fails with the error:
"Driver 'dgnc' is already registered."
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---
drivers/staging/dgnc/dgnc_driver.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 1d1d5c8..22a92d1 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -156,8 +156,7 @@ static void dgnc_cleanup_module(void)
dgnc_tty_post_uninit();
- if (dgnc_NumBoards)
- pci_unregister_driver(&dgnc_driver);
+ pci_unregister_driver(&dgnc_driver);
}
/*
--
1.9.1
next prev parent reply other threads:[~2016-02-27 12:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-27 12:03 [PATCH 1/4] staging: dgnc: remove unneeded else Sudip Mukherjee
2016-02-27 12:03 ` [PATCH 2/4] staging: dgnc: remove pci_unregister_driver Sudip Mukherjee
2016-02-27 12:03 ` Sudip Mukherjee [this message]
2016-02-27 12:03 ` [PATCH 4/4] staging: dgnc: cleanup properly Sudip Mukherjee
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=1456574615-32003-3-git-send-email-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=lidza.louina@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markh@compro.net \
/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