From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-parport@lists.infradead.org,
"Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
Subject: [PATCH] parport: parport_pc: PCI SIO access should also depend on SIO option
Date: Wed, 20 Apr 2016 13:09:51 +0530 [thread overview]
Message-ID: <1461137991-3834-1-git-send-email-sudipm.mukherjee@gmail.com> (raw)
From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
CONFIG_PARPORT_PC_SUPERIO toggles Super IO chip support in parport_pc
code, however only code accessing SIO chip via ISA (or LPC) bus was
conditional on it.
This patch makes SIO chip accesses via PCI bus also dependent on this
config option.
It should be noted that Super IO support in parport_pc is needed only when
firmware has failed to make parallel port available either via PNP or
on standard I/O ranges and user has one of a few supported SIOs.
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
---
Hi Greg,
This patch is not tested on any superio chip based hardware. (I also
don't have one).
http://www.spinics.net/lists/kernel/msg2227051.html
I know you dislike adding #ifdef so its upto you.
drivers/parport/parport_pc.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 78530d1..b241fb0 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2301,6 +2301,7 @@ EXPORT_SYMBOL(parport_pc_unregister_port);
#ifdef CONFIG_PCI
+#ifdef CONFIG_PARPORT_PC_SUPERIO
/* ITE support maintained by Rich Liu <richliu@poorman.org> */
static int sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, int autodma,
const struct parport_pc_via_data *via)
@@ -2611,6 +2612,9 @@ static struct parport_pc_superio {
{ sio_via_probe, &via_8231_data, },
{ sio_ite_8872_probe, NULL, },
};
+#else
+#define last_sio 0
+#endif /* CONFIG_PARPORT_PC_SUPERIO */
enum parport_pc_pci_cards {
siig_1p_10x = last_sio,
@@ -2711,11 +2715,13 @@ static struct parport_pc_pci {
};
static const struct pci_device_id parport_pc_pci_tbl[] = {
+#ifdef CONFIG_PARPORT_PC_SUPERIO
/* Super-IO onboard chips */
{ 0x1106, 0x0686, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_via_686a },
{ 0x1106, 0x8231, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_via_8231 },
{ PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, sio_ite_8872 },
+#endif
/* PCI cards */
{ PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1P_10x,
@@ -2900,7 +2906,11 @@ static struct pci_driver parport_pc_pci_driver = {
.probe = parport_pc_pci_probe,
.remove = parport_pc_pci_remove,
};
+#else
+static struct pci_driver parport_pc_pci_driver;
+#endif /* CONFIG_PCI */
+#if defined(CONFIG_PCI) && defined(CONFIG_PARPORT_PC_SUPERIO)
static int __init parport_pc_init_superio(int autoirq, int autodma)
{
const struct pci_device_id *id;
@@ -2922,12 +2932,11 @@ static int __init parport_pc_init_superio(int autoirq, int autodma)
return ret; /* number of devices found */
}
#else
-static struct pci_driver parport_pc_pci_driver;
static int __init parport_pc_init_superio(int autoirq, int autodma)
{
return 0;
}
-#endif /* CONFIG_PCI */
+#endif
#ifdef CONFIG_PNP
@@ -3125,7 +3134,7 @@ static int __init parport_parse_dma(const char *dmastr, int *val)
PARPORT_DMA_NONE, PARPORT_DMA_NOFIFO);
}
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(CONFIG_PARPORT_PC_SUPERIO)
static int __init parport_init_mode_setup(char *str)
{
printk(KERN_DEBUG
@@ -3162,7 +3171,7 @@ module_param_array(dma, charp, NULL, 0);
MODULE_PARM_DESC(verbose_probing, "Log chit-chat during initialisation");
module_param(verbose_probing, int, 0644);
#endif
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(CONFIG_PARPORT_PC_SUPERIO)
static char *init_mode;
MODULE_PARM_DESC(init_mode,
"Initialise mode for VIA VT8231 port (spp, ps2, epp, ecp or ecpepp)");
@@ -3174,7 +3183,7 @@ static int __init parse_parport_params(void)
unsigned int i;
int val;
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(CONFIG_PARPORT_PC_SUPERIO)
if (init_mode)
parport_init_mode_setup(init_mode);
#endif
@@ -3292,7 +3301,7 @@ __setup("parport=", parport_setup);
*
* parport_init_mode=[spp|ps2|epp|ecp|ecpepp]
*/
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && defined(CONFIG_PARPORT_PC_SUPERIO)
__setup("parport_init_mode=", parport_init_mode_setup);
#endif
#endif
--
1.9.1
next reply other threads:[~2016-04-20 7:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 7:39 Sudip Mukherjee [this message]
2016-04-30 20:56 ` Greg Kroah-Hartman
2016-05-01 7:45 ` Sudip Mukherjee
2016-05-01 14:07 ` Maciej S. Szmigiero
2016-05-01 19:46 ` Sudip Mukherjee
-- strict thread matches above, loose matches on Subject: below --
2016-03-05 17:46 Maciej S. Szmigiero
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=1461137991-3834-1-git-send-email-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parport@lists.infradead.org \
--cc=mail@maciej.szmigiero.name \
/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
all inboxes | Powered by JetHome®