From 0b2ee9391079a5092eb99dce764e3836eeb92cd9 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sat, 15 Jun 2013 19:58:35 +0200 Subject: [PATCH] pnp: Remove now plain wrappers for default PnP functions After removing the enter()/exit() functions for configuration mode, most wrappers for our standard PnP functions just call the underlying default implementation. Remove those with a little cocci: @ op_match @ identifier op; identifier pnp_op =~ "^pnp_((alt_|)enable|(set|enable)_resources)$"; type device_t; identifier dev; @@ static void op(device_t dev) { pnp_op(dev); } @@ identifier op_match.op; @@ -op(...) {...} /* Three rules to match the alignment, hmmp... */ @@ identifier op_match.op, op_match.pnp_op; identifier ops; @@ struct device_operations ops = { - .set_resources = op, + .set_resources = pnp_op, }; @@ identifier op_match.op, op_match.pnp_op; identifier ops; @@ struct device_operations ops = { - .enable_resources = op, + .enable_resources = pnp_op, }; @@ identifier op_match.op, op_match.pnp_op; identifier ops; @@ struct device_operations ops = { - .enable = op, + .enable = pnp_op, }; Change-Id: Idc0e52c7e3600a01f3b6a4e17763557b271b481e Signed-off-by: Nico Huber Reviewed-on: http://review.coreboot.org/3483 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Marc Jones Reviewed-by: Stefan Reinauer --- src/superio/fintek/f71805f/superio.c | 21 +++-------------- src/superio/fintek/f71859/superio.c | 21 +++-------------- src/superio/fintek/f71863fg/superio.c | 21 +++-------------- src/superio/fintek/f71872/superio.c | 21 +++-------------- src/superio/fintek/f71889/superio.c | 21 +++-------------- src/superio/fintek/f81865f/superio.c | 21 +++-------------- src/superio/intel/i3100/superio.c | 21 +++-------------- src/superio/ite/it8712f/superio.c | 21 +++-------------- src/superio/ite/it8716f/superio.c | 21 +++-------------- src/superio/ite/it8772f/superio.c | 21 +++-------------- src/superio/nuvoton/nct5104d/superio.c | 21 +++-------------- src/superio/smsc/kbc1100/superio.c | 24 +++----------------- src/superio/smsc/lpc47b272/superio.c | 30 +++---------------------- src/superio/smsc/lpc47b397/superio.c | 18 ++++----------- src/superio/smsc/lpc47m10x/superio.c | 30 +++---------------------- src/superio/smsc/lpc47m15x/superio.c | 24 +++----------------- src/superio/smsc/mec1308/superio.c | 21 +++-------------- src/superio/smsc/sch4037/superio.c | 24 +++----------------- src/superio/smsc/sio1036/superio.c | 24 +++----------------- src/superio/smsc/smscsuperio/superio.c | 29 +++--------------------- src/superio/via/vt1211/vt1211.c | 7 +----- src/superio/winbond/w83627dhg/superio.c | 21 +++-------------- src/superio/winbond/w83627ehg/superio.c | 14 ++---------- src/superio/winbond/w83627hf/superio.c | 14 ++---------- src/superio/winbond/w83627thg/superio.c | 21 +++-------------- src/superio/winbond/w83627uhg/superio.c | 21 +++-------------- src/superio/winbond/w83697hf/superio.c | 21 +++-------------- src/superio/winbond/w83977f/superio.c | 21 +++-------------- src/superio/winbond/w83977tf/superio.c | 21 +++-------------- 29 files changed, 84 insertions(+), 532 deletions(-) diff --git a/src/superio/fintek/f71805f/superio.c b/src/superio/fintek/f71805f/superio.c index 3fb0c7632e..50c3355ce9 100644 --- a/src/superio/fintek/f71805f/superio.c +++ b/src/superio/fintek/f71805f/superio.c @@ -45,21 +45,6 @@ static void f71805f_init(device_t dev) /* TODO: Might potentially need code for HWM or FDC etc. */ } -static void f71805f_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void f71805f_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void f71805f_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_conf_state, .exit_conf_mode = pnp_exit_conf_state, @@ -67,9 +52,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = f71805f_pnp_set_resources, - .enable_resources = f71805f_pnp_enable_resources, - .enable = f71805f_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = f71805f_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/fintek/f71859/superio.c b/src/superio/fintek/f71859/superio.c index 1f52ad7c8f..1e5b6ecd4d 100644 --- a/src/superio/fintek/f71859/superio.c +++ b/src/superio/fintek/f71859/superio.c @@ -46,21 +46,6 @@ static void f71859_init(device_t dev) /* TODO: Might potentially need code for HWM or FDC etc. */ } -static void f71859_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void f71859_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void f71859_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_conf_state, .exit_conf_mode = pnp_exit_conf_state, @@ -68,9 +53,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = f71859_pnp_set_resources, - .enable_resources = f71859_pnp_enable_resources, - .enable = f71859_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = f71859_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/fintek/f71863fg/superio.c b/src/superio/fintek/f71863fg/superio.c index 4aab676885..84a7ec1397 100644 --- a/src/superio/fintek/f71863fg/superio.c +++ b/src/superio/fintek/f71863fg/superio.c @@ -55,21 +55,6 @@ static void f71863fg_init(device_t dev) } } -static void f71863fg_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void f71863fg_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void f71863fg_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_conf_state, .exit_conf_mode = pnp_exit_conf_state, @@ -77,9 +62,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = f71863fg_pnp_set_resources, - .enable_resources = f71863fg_pnp_enable_resources, - .enable = f71863fg_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = f71863fg_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/fintek/f71872/superio.c b/src/superio/fintek/f71872/superio.c index 8bc2b9496d..8db22a9f28 100644 --- a/src/superio/fintek/f71872/superio.c +++ b/src/superio/fintek/f71872/superio.c @@ -52,21 +52,6 @@ static void f71872_init(device_t dev) } } -static void f71872_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void f71872_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void f71872_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_conf_state, .exit_conf_mode = pnp_exit_conf_state, @@ -74,9 +59,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = f71872_pnp_set_resources, - .enable_resources = f71872_pnp_enable_resources, - .enable = f71872_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = f71872_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/fintek/f71889/superio.c b/src/superio/fintek/f71889/superio.c index 5017505db4..8de8ae82e3 100644 --- a/src/superio/fintek/f71889/superio.c +++ b/src/superio/fintek/f71889/superio.c @@ -53,21 +53,6 @@ static void f71889_init(device_t dev) } } -static void f71889_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void f71889_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void f71889_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_conf_state, .exit_conf_mode = pnp_exit_conf_state, @@ -75,9 +60,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = f71889_pnp_set_resources, - .enable_resources = f71889_pnp_enable_resources, - .enable = f71889_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = f71889_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/fintek/f81865f/superio.c b/src/superio/fintek/f81865f/superio.c index ea322ea3c0..050602c96a 100644 --- a/src/superio/fintek/f81865f/superio.c +++ b/src/superio/fintek/f81865f/superio.c @@ -52,21 +52,6 @@ static void f81865f_init(device_t dev) } } -static void f81865f_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void f81865f_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void f81865f_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_conf_state, .exit_conf_mode = pnp_exit_conf_state, @@ -74,9 +59,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = f81865f_pnp_set_resources, - .enable_resources = f81865f_pnp_enable_resources, - .enable = f81865f_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = f81865f_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/intel/i3100/superio.c b/src/superio/intel/i3100/superio.c index 503a233935..f791d9d54a 100644 --- a/src/superio/intel/i3100/superio.c +++ b/src/superio/intel/i3100/superio.c @@ -43,21 +43,6 @@ static void i3100_init(device_t dev) return; } -static void i3100_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void i3100_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void i3100_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_ext_func_mode, .exit_conf_mode = pnp_exit_ext_func_mode, @@ -65,9 +50,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = i3100_pnp_set_resources, - .enable_resources = i3100_pnp_enable_resources, - .enable = i3100_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = i3100_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/ite/it8712f/superio.c b/src/superio/ite/it8712f/superio.c index c713a6871a..619b2602f8 100644 --- a/src/superio/ite/it8712f/superio.c +++ b/src/superio/ite/it8712f/superio.c @@ -72,21 +72,6 @@ static void it8712f_init(device_t dev) } } -static void it8712f_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void it8712f_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void it8712f_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_ext_func_mode, .exit_conf_mode = pnp_exit_ext_func_mode, @@ -94,9 +79,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = it8712f_pnp_set_resources, - .enable_resources = it8712f_pnp_enable_resources, - .enable = it8712f_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = it8712f_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/ite/it8716f/superio.c b/src/superio/ite/it8716f/superio.c index af0db2d18e..4b58bb4a47 100644 --- a/src/superio/ite/it8716f/superio.c +++ b/src/superio/ite/it8716f/superio.c @@ -96,21 +96,6 @@ static void it8716f_init(device_t dev) } } -static void it8716f_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void it8716f_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void it8716f_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_ext_func_mode, .exit_conf_mode = pnp_exit_ext_func_mode, @@ -118,9 +103,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = it8716f_pnp_set_resources, - .enable_resources = it8716f_pnp_enable_resources, - .enable = it8716f_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = it8716f_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/ite/it8772f/superio.c b/src/superio/ite/it8772f/superio.c index 5985db52e0..5004c102a1 100644 --- a/src/superio/ite/it8772f/superio.c +++ b/src/superio/ite/it8772f/superio.c @@ -188,21 +188,6 @@ static void it8772f_init(device_t dev) } } -static void it8772f_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void it8772f_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void it8772f_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_ext_func_mode, .exit_conf_mode = pnp_exit_ext_func_mode, @@ -210,9 +195,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = it8772f_pnp_set_resources, - .enable_resources = it8772f_pnp_enable_resources, - .enable = it8772f_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = it8772f_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/nuvoton/nct5104d/superio.c b/src/superio/nuvoton/nct5104d/superio.c index 4615444d53..c8b696dab0 100755 --- a/src/superio/nuvoton/nct5104d/superio.c +++ b/src/superio/nuvoton/nct5104d/superio.c @@ -38,21 +38,6 @@ static void nct5104d_init(device_t dev) { } -static void nct5104d_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void nct5104d_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void nct5104d_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_exteded_mode, .exit_conf_mode = pnp_exit_extended_mode, @@ -60,9 +45,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = nct5104d_pnp_set_resources, - .enable_resources = nct5104d_pnp_enable_resources, - .enable = nct5104d_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = nct5104d_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/smsc/kbc1100/superio.c b/src/superio/smsc/kbc1100/superio.c index 21888994a4..a6d0ef0b64 100644 --- a/src/superio/smsc/kbc1100/superio.c +++ b/src/superio/smsc/kbc1100/superio.c @@ -33,9 +33,6 @@ /* Forward declarations */ static void enable_dev(device_t dev); -static void kbc1100_pnp_set_resources(device_t dev); -static void kbc1100_pnp_enable_resources(device_t dev); -static void kbc1100_pnp_enable(device_t dev); static void kbc1100_init(device_t dev); static void pnp_enter_conf_state(device_t dev); @@ -53,9 +50,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = kbc1100_pnp_set_resources, - .enable_resources = kbc1100_pnp_enable_resources, - .enable = kbc1100_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = kbc1100_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; @@ -69,21 +66,6 @@ static void enable_dev(device_t dev) pnp_enable_devices(dev, &pnp_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); } -static void kbc1100_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void kbc1100_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void kbc1100_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static void kbc1100_init(device_t dev) { struct superio_smsc_kbc1100_config *conf = dev->chip_info; diff --git a/src/superio/smsc/lpc47b272/superio.c b/src/superio/smsc/lpc47b272/superio.c index 051b339e35..d06f09457e 100644 --- a/src/superio/smsc/lpc47b272/superio.c +++ b/src/superio/smsc/lpc47b272/superio.c @@ -37,9 +37,6 @@ /* Forward declarations */ static void enable_dev(device_t dev); -static void lpc47b272_pnp_set_resources(device_t dev); -static void lpc47b272_pnp_enable_resources(device_t dev); -static void lpc47b272_pnp_enable(device_t dev); static void lpc47b272_init(device_t dev); static void pnp_enter_conf_state(device_t dev); @@ -58,9 +55,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = lpc47b272_pnp_set_resources, - .enable_resources = lpc47b272_pnp_enable_resources, - .enable = lpc47b272_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = lpc47b272_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; @@ -86,27 +83,6 @@ static void enable_dev(device_t dev) pnp_dev_info); } -/** - * Configure the specified Super I/O device with the resources (I/O space, - * etc.) that have been allocated for it. - * - * @param dev Pointer to structure describing a Super I/O device. - */ -static void lpc47b272_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void lpc47b272_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void lpc47b272_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - /** * Initialize the specified Super I/O device. * diff --git a/src/superio/smsc/lpc47b397/superio.c b/src/superio/smsc/lpc47b397/superio.c index e8c62cdc01..850b7bbbf4 100644 --- a/src/superio/smsc/lpc47b397/superio.c +++ b/src/superio/smsc/lpc47b397/superio.c @@ -78,11 +78,6 @@ static void lpc47b397_init(device_t dev) } } -static void lpc47b397_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - static void lpc47b397_pnp_enable_resources(device_t dev) { pnp_enable_resources(dev); @@ -99,11 +94,6 @@ static void lpc47b397_pnp_enable_resources(device_t dev) pnp_exit_conf_mode(dev); } -static void lpc47b397_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_conf_state, .exit_conf_mode = pnp_exit_conf_state, @@ -111,9 +101,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = lpc47b397_pnp_set_resources, + .set_resources = pnp_set_resources, .enable_resources = lpc47b397_pnp_enable_resources, - .enable = lpc47b397_pnp_enable, + .enable = pnp_alt_enable, .init = lpc47b397_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; @@ -169,9 +159,9 @@ static struct smbus_bus_operations lops_smbus_bus = { static struct device_operations ops_hwm = { .read_resources = pnp_read_resources, - .set_resources = lpc47b397_pnp_set_resources, + .set_resources = pnp_set_resources, .enable_resources = lpc47b397_pnp_enable_resources, - .enable = lpc47b397_pnp_enable, + .enable = pnp_alt_enable, .init = lpc47b397_init, .scan_bus = scan_static_bus, .ops_smbus_bus = &lops_smbus_bus, diff --git a/src/superio/smsc/lpc47m10x/superio.c b/src/superio/smsc/lpc47m10x/superio.c index 0b55110190..925defa526 100644 --- a/src/superio/smsc/lpc47m10x/superio.c +++ b/src/superio/smsc/lpc47m10x/superio.c @@ -36,9 +36,6 @@ /* Forward declarations */ static void enable_dev(device_t dev); -static void lpc47m10x_pnp_set_resources(device_t dev); -static void lpc47m10x_pnp_enable_resources(device_t dev); -static void lpc47m10x_pnp_enable(device_t dev); static void lpc47m10x_init(device_t dev); static void pnp_enter_conf_state(device_t dev); @@ -57,9 +54,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = lpc47m10x_pnp_set_resources, - .enable_resources = lpc47m10x_pnp_enable_resources, - .enable = lpc47m10x_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = lpc47m10x_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; @@ -85,27 +82,6 @@ static void enable_dev(device_t dev) pnp_dev_info); } -/** - * Configure the specified Super I/O device with the resources (I/O space, - * etc.) that have been allocated for it. - * - * @param dev Pointer to structure describing a Super I/O device. - */ -static void lpc47m10x_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void lpc47m10x_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void lpc47m10x_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - /** * Initialize the specified Super I/O device. * diff --git a/src/superio/smsc/lpc47m15x/superio.c b/src/superio/smsc/lpc47m15x/superio.c index bcccb7a636..a3b8fc5e73 100644 --- a/src/superio/smsc/lpc47m15x/superio.c +++ b/src/superio/smsc/lpc47m15x/superio.c @@ -33,9 +33,6 @@ /* Forward declarations */ static void enable_dev(device_t dev); -static void lpc47m15x_pnp_set_resources(device_t dev); -static void lpc47m15x_pnp_enable_resources(device_t dev); -static void lpc47m15x_pnp_enable(device_t dev); static void lpc47m15x_init(device_t dev); static void pnp_enter_conf_state(device_t dev); @@ -53,9 +50,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = lpc47m15x_pnp_set_resources, - .enable_resources = lpc47m15x_pnp_enable_resources, - .enable = lpc47m15x_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = lpc47m15x_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; @@ -74,21 +71,6 @@ static void enable_dev(device_t dev) ARRAY_SIZE(pnp_dev_info), pnp_dev_info); } -static void lpc47m15x_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void lpc47m15x_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void lpc47m15x_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static void lpc47m15x_init(device_t dev) { struct superio_smsc_lpc47m15x_config *conf = dev->chip_info; diff --git a/src/superio/smsc/mec1308/superio.c b/src/superio/smsc/mec1308/superio.c index d08de2fbc9..0385b26b90 100644 --- a/src/superio/smsc/mec1308/superio.c +++ b/src/superio/smsc/mec1308/superio.c @@ -43,21 +43,6 @@ static void pnp_exit_conf_state(device_t dev) outb(0xaa, dev->path.pnp.port); } -static void mec1308_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void mec1308_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void mec1308_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static void mec1308_init(device_t dev) { struct superio_smsc_mec1308_config *conf = dev->chip_info; @@ -83,9 +68,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = mec1308_pnp_set_resources, - .enable_resources = mec1308_pnp_enable_resources, - .enable = mec1308_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = mec1308_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/smsc/sch4037/superio.c b/src/superio/smsc/sch4037/superio.c index c6daa18d9a..254b8386ba 100644 --- a/src/superio/smsc/sch4037/superio.c +++ b/src/superio/smsc/sch4037/superio.c @@ -33,9 +33,6 @@ /* Forward declarations */ static void enable_dev(device_t dev); -static void sch4037_pnp_set_resources(device_t dev); -static void sch4037_pnp_enable_resources(device_t dev); -static void sch4037_pnp_enable(device_t dev); static void sch4037_init(device_t dev); static void pnp_enter_conf_state(device_t dev); @@ -53,9 +50,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = sch4037_pnp_set_resources, - .enable_resources = sch4037_pnp_enable_resources, - .enable = sch4037_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = sch4037_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; @@ -70,21 +67,6 @@ static void enable_dev(device_t dev) pnp_enable_devices(dev, &pnp_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); } -static void sch4037_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void sch4037_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void sch4037_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static void sch4037_init(device_t dev) { struct superio_smsc_sch4037_config *conf = dev->chip_info; diff --git a/src/superio/smsc/sio1036/superio.c b/src/superio/smsc/sio1036/superio.c index 834fd492f4..2ce2af2787 100644 --- a/src/superio/smsc/sio1036/superio.c +++ b/src/superio/smsc/sio1036/superio.c @@ -33,9 +33,6 @@ /* Forward declarations */ static void enable_dev(device_t dev); -static void sio1036_pnp_set_resources(device_t dev); -static void sio1036_pnp_enable_resources(device_t dev); -static void sio1036_pnp_enable(device_t dev); static void sio1036_init(device_t dev); static void pnp_enter_conf_state(device_t dev); @@ -53,9 +50,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = sio1036_pnp_set_resources, - .enable_resources = sio1036_pnp_enable_resources, - .enable = sio1036_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = sio1036_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; @@ -69,21 +66,6 @@ static void enable_dev(device_t dev) pnp_enable_devices(dev, &pnp_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info); } -static void sio1036_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void sio1036_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void sio1036_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static void sio1036_init(device_t dev) { struct superio_smsc_sio1036_config *conf = dev->chip_info; diff --git a/src/superio/smsc/smscsuperio/superio.c b/src/superio/smsc/smscsuperio/superio.c index 9af67a1c02..d45a9671c1 100644 --- a/src/superio/smsc/smscsuperio/superio.c +++ b/src/superio/smsc/smscsuperio/superio.c @@ -169,29 +169,6 @@ static void smsc_pnp_exit_conf_state(device_t dev) outb(0xaa, dev->path.pnp.port); } -/** Wrapper for pnp_set_resources(). */ -static void smsc_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -/** Wrapper for pnp_enable_resources(). */ -static void smsc_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -/** - * If so configured, enable the specified device, otherwise - * explicitly disable it. - * - * @param dev The device to use. - */ -static void smsc_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - /** * Initialize those logical devices which need a special init. * @@ -230,9 +207,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { /** Standard device operations. */ static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = smsc_pnp_set_resources, - .enable_resources = smsc_pnp_enable_resources, - .enable = smsc_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = smsc_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/via/vt1211/vt1211.c b/src/superio/via/vt1211/vt1211.c index b66d530985..8e09e4a50e 100644 --- a/src/superio/via/vt1211/vt1211.c +++ b/src/superio/via/vt1211/vt1211.c @@ -172,11 +172,6 @@ static void vt1211_pnp_set_resources(struct device *dev) pnp_exit_conf_mode(dev); } -static void vt1211_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_ext_func_mode, .exit_conf_mode = pnp_exit_ext_func_mode, @@ -186,7 +181,7 @@ struct device_operations ops = { .read_resources = pnp_read_resources, .set_resources = vt1211_pnp_set_resources, .enable_resources = vt1211_pnp_enable_resources, - .enable = vt1211_pnp_enable, + .enable = pnp_alt_enable, .init = vt1211_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/winbond/w83627dhg/superio.c b/src/superio/winbond/w83627dhg/superio.c index d742112a49..1a83b3d010 100644 --- a/src/superio/winbond/w83627dhg/superio.c +++ b/src/superio/winbond/w83627dhg/superio.c @@ -65,21 +65,6 @@ static void w83627dhg_init(device_t dev) } } -static void w83627dhg_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void w83627dhg_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void w83627dhg_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_ext_func_mode, .exit_conf_mode = pnp_exit_ext_func_mode, @@ -87,9 +72,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = w83627dhg_pnp_set_resources, - .enable_resources = w83627dhg_pnp_enable_resources, - .enable = w83627dhg_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = w83627dhg_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/winbond/w83627ehg/superio.c b/src/superio/winbond/w83627ehg/superio.c index a94c4c0030..631105b2f8 100644 --- a/src/superio/winbond/w83627ehg/superio.c +++ b/src/superio/winbond/w83627ehg/superio.c @@ -127,11 +127,6 @@ static void w83627ehg_init(device_t dev) } } -static void w83627ehg_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - static void w83627ehg_pnp_enable_resources(device_t dev) { pnp_enable_resources(dev); @@ -146,11 +141,6 @@ static void w83627ehg_pnp_enable_resources(device_t dev) pnp_exit_conf_mode(dev); } -static void w83627ehg_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_ext_func_mode, .exit_conf_mode = pnp_exit_ext_func_mode, @@ -158,9 +148,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = w83627ehg_pnp_set_resources, + .set_resources = pnp_set_resources, .enable_resources = w83627ehg_pnp_enable_resources, - .enable = w83627ehg_pnp_enable, + .enable = pnp_alt_enable, .init = w83627ehg_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/winbond/w83627hf/superio.c b/src/superio/winbond/w83627hf/superio.c index 625f149ec7..4d68c35033 100644 --- a/src/superio/winbond/w83627hf/superio.c +++ b/src/superio/winbond/w83627hf/superio.c @@ -134,11 +134,6 @@ static void w83627hf_init(device_t dev) } } -static void w83627hf_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - static void w83627hf_pnp_enable_resources(device_t dev) { pnp_enable_resources(dev); @@ -153,11 +148,6 @@ static void w83627hf_pnp_enable_resources(device_t dev) pnp_exit_conf_mode(dev); } -static void w83627hf_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_ext_func_mode, .exit_conf_mode = pnp_exit_ext_func_mode, @@ -165,9 +155,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = w83627hf_pnp_set_resources, + .set_resources = pnp_set_resources, .enable_resources = w83627hf_pnp_enable_resources, - .enable = w83627hf_pnp_enable, + .enable = pnp_alt_enable, .init = w83627hf_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/winbond/w83627thg/superio.c b/src/superio/winbond/w83627thg/superio.c index 70d0c3d8d0..f1c56032c5 100644 --- a/src/superio/winbond/w83627thg/superio.c +++ b/src/superio/winbond/w83627thg/superio.c @@ -55,21 +55,6 @@ static void w83627thg_init(device_t dev) } } -static void w83627thg_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void w83627thg_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void w83627thg_enable(device_t dev) -{ - pnp_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = w83627thg_enter_ext_func_mode, .exit_conf_mode = w83627thg_exit_ext_func_mode, @@ -77,9 +62,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = w83627thg_set_resources, - .enable_resources = w83627thg_enable_resources, - .enable = w83627thg_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_enable, .init = w83627thg_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/winbond/w83627uhg/superio.c b/src/superio/winbond/w83627uhg/superio.c index adae491a32..d2cbdc945c 100644 --- a/src/superio/winbond/w83627uhg/superio.c +++ b/src/superio/winbond/w83627uhg/superio.c @@ -101,21 +101,6 @@ static void w83627uhg_init(device_t dev) } } -static void w83627uhg_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void w83627uhg_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void w83627uhg_enable(device_t dev) -{ - pnp_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = w83627uhg_enter_ext_func_mode, .exit_conf_mode = w83627uhg_exit_ext_func_mode, @@ -123,9 +108,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = w83627uhg_set_resources, - .enable_resources = w83627uhg_enable_resources, - .enable = w83627uhg_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_enable, .init = w83627uhg_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/winbond/w83697hf/superio.c b/src/superio/winbond/w83697hf/superio.c index 2dd4f4f8dd..9431b34d23 100644 --- a/src/superio/winbond/w83697hf/superio.c +++ b/src/superio/winbond/w83697hf/superio.c @@ -81,21 +81,6 @@ static void w83697hf_init(device_t dev) } } -static void w83697hf_pnp_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void w83697hf_pnp_enable(device_t dev) -{ - pnp_alt_enable(dev); -} - -static void w83697hf_pnp_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = pnp_enter_ext_func_mode, .exit_conf_mode = pnp_exit_ext_func_mode, @@ -103,9 +88,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = w83697hf_pnp_set_resources, - .enable_resources = w83697hf_pnp_enable_resources, - .enable = w83697hf_pnp_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_alt_enable, .init = w83697hf_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/winbond/w83977f/superio.c b/src/superio/winbond/w83977f/superio.c index a88cbe5cc0..8368839d26 100644 --- a/src/superio/winbond/w83977f/superio.c +++ b/src/superio/winbond/w83977f/superio.c @@ -54,21 +54,6 @@ static void w83977f_init(device_t dev) } } -static void w83977f_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void w83977f_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void w83977f_enable(device_t dev) -{ - pnp_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = w83977f_enter_ext_func_mode, .exit_conf_mode = w83977f_exit_ext_func_mode, @@ -76,9 +61,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = w83977f_set_resources, - .enable_resources = w83977f_enable_resources, - .enable = w83977f_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_enable, .init = w83977f_init, .ops_pnp_mode = &pnp_conf_mode_ops, }; diff --git a/src/superio/winbond/w83977tf/superio.c b/src/superio/winbond/w83977tf/superio.c index 30c291717d..ff55f5d2f6 100644 --- a/src/superio/winbond/w83977tf/superio.c +++ b/src/superio/winbond/w83977tf/superio.c @@ -56,21 +56,6 @@ static void w83977tf_init(device_t dev) } } -static void w83977tf_set_resources(device_t dev) -{ - pnp_set_resources(dev); -} - -static void w83977tf_enable_resources(device_t dev) -{ - pnp_enable_resources(dev); -} - -static void w83977tf_enable(device_t dev) -{ - pnp_enable(dev); -} - static const struct pnp_mode_ops pnp_conf_mode_ops = { .enter_conf_mode = w83977tf_enter_ext_func_mode, .exit_conf_mode = w83977tf_exit_ext_func_mode, @@ -78,9 +63,9 @@ static const struct pnp_mode_ops pnp_conf_mode_ops = { static struct device_operations ops = { .read_resources = pnp_read_resources, - .set_resources = w83977tf_set_resources, - .enable_resources = w83977tf_enable_resources, - .enable = w83977tf_enable, + .set_resources = pnp_set_resources, + .enable_resources = pnp_enable_resources, + .enable = pnp_enable, .init = w83977tf_init, .ops_pnp_mode = &pnp_conf_mode_ops, };