diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-04-02 08:05:02 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-04-10 10:51:14 -0400 |
commit | 5da3dac8d99c9933f12286fd73fa18e26f768bea (patch) | |
tree | 8db17c8e7996c92381920a0e97380a5adc8a6d7a /drivers/firewire/ohci.c | |
parent | 35d999b12037b5ea0152889232629c25d45b0e26 (diff) |
firewire: ohci: cleanups and fix for nonstandard build without debug facility
1) Clean up two function names: The ohci_ prefix is only used in names
of fw_card_driver hooks. There were two unnecessary exceptions.
2) Replace empty macros by empty inline functions so that call parameter
type checking is available in #ifndef'd builds.
3) CONFIG_FIREWIRE_OHCI_DEBUG is currently a hidden kconfig variable,
hence is not going to be switched off by anybody. Still, it can be
switched off but then compilation will fail in ohci_enable() at the
expression param_debug & OHCI_PARAM_DEBUG_BUSRESETS. Add the necessary
definitions in the nonstandard case.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/ohci.c')
-rw-r--r-- | drivers/firewire/ohci.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 5bbf42eb3f9a..07deac77bc13 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -262,13 +262,13 @@ MODULE_PARM_DESC(quirks, "Chip quirks (default = 0" | |||
262 | ", no 1394a enhancements = " __stringify(QUIRK_NO_1394A) | 262 | ", no 1394a enhancements = " __stringify(QUIRK_NO_1394A) |
263 | ")"); | 263 | ")"); |
264 | 264 | ||
265 | #ifdef CONFIG_FIREWIRE_OHCI_DEBUG | ||
266 | |||
267 | #define OHCI_PARAM_DEBUG_AT_AR 1 | 265 | #define OHCI_PARAM_DEBUG_AT_AR 1 |
268 | #define OHCI_PARAM_DEBUG_SELFIDS 2 | 266 | #define OHCI_PARAM_DEBUG_SELFIDS 2 |
269 | #define OHCI_PARAM_DEBUG_IRQS 4 | 267 | #define OHCI_PARAM_DEBUG_IRQS 4 |
270 | #define OHCI_PARAM_DEBUG_BUSRESETS 8 /* only effective before chip init */ | 268 | #define OHCI_PARAM_DEBUG_BUSRESETS 8 /* only effective before chip init */ |
271 | 269 | ||
270 | #ifdef CONFIG_FIREWIRE_OHCI_DEBUG | ||
271 | |||
272 | static int param_debug; | 272 | static int param_debug; |
273 | module_param_named(debug, param_debug, int, 0644); | 273 | module_param_named(debug, param_debug, int, 0644); |
274 | MODULE_PARM_DESC(debug, "Verbose logging (default = 0" | 274 | MODULE_PARM_DESC(debug, "Verbose logging (default = 0" |
@@ -441,9 +441,10 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt) | |||
441 | 441 | ||
442 | #else | 442 | #else |
443 | 443 | ||
444 | #define log_irqs(evt) | 444 | #define param_debug 0 |
445 | #define log_selfids(node_id, generation, self_id_count, sid) | 445 | static inline void log_irqs(u32 evt) {} |
446 | #define log_ar_at_event(dir, speed, header, evt) | 446 | static inline void log_selfids(int node_id, int generation, int self_id_count, u32 *s) {} |
447 | static inline void log_ar_at_event(char dir, int speed, u32 *header, int evt) {} | ||
447 | 448 | ||
448 | #endif /* CONFIG_FIREWIRE_OHCI_DEBUG */ | 449 | #endif /* CONFIG_FIREWIRE_OHCI_DEBUG */ |
449 | 450 | ||
@@ -2401,7 +2402,7 @@ static const struct fw_card_driver ohci_driver = { | |||
2401 | }; | 2402 | }; |
2402 | 2403 | ||
2403 | #ifdef CONFIG_PPC_PMAC | 2404 | #ifdef CONFIG_PPC_PMAC |
2404 | static void ohci_pmac_on(struct pci_dev *dev) | 2405 | static void pmac_ohci_on(struct pci_dev *dev) |
2405 | { | 2406 | { |
2406 | if (machine_is(powermac)) { | 2407 | if (machine_is(powermac)) { |
2407 | struct device_node *ofn = pci_device_to_OF_node(dev); | 2408 | struct device_node *ofn = pci_device_to_OF_node(dev); |
@@ -2413,7 +2414,7 @@ static void ohci_pmac_on(struct pci_dev *dev) | |||
2413 | } | 2414 | } |
2414 | } | 2415 | } |
2415 | 2416 | ||
2416 | static void ohci_pmac_off(struct pci_dev *dev) | 2417 | static void pmac_ohci_off(struct pci_dev *dev) |
2417 | { | 2418 | { |
2418 | if (machine_is(powermac)) { | 2419 | if (machine_is(powermac)) { |
2419 | struct device_node *ofn = pci_device_to_OF_node(dev); | 2420 | struct device_node *ofn = pci_device_to_OF_node(dev); |
@@ -2425,8 +2426,8 @@ static void ohci_pmac_off(struct pci_dev *dev) | |||
2425 | } | 2426 | } |
2426 | } | 2427 | } |
2427 | #else | 2428 | #else |
2428 | #define ohci_pmac_on(dev) | 2429 | static inline void pmac_ohci_on(struct pci_dev *dev) {} |
2429 | #define ohci_pmac_off(dev) | 2430 | static inline void pmac_ohci_off(struct pci_dev *dev) {} |
2430 | #endif /* CONFIG_PPC_PMAC */ | 2431 | #endif /* CONFIG_PPC_PMAC */ |
2431 | 2432 | ||
2432 | static int __devinit pci_probe(struct pci_dev *dev, | 2433 | static int __devinit pci_probe(struct pci_dev *dev, |
@@ -2446,7 +2447,7 @@ static int __devinit pci_probe(struct pci_dev *dev, | |||
2446 | 2447 | ||
2447 | fw_card_initialize(&ohci->card, &ohci_driver, &dev->dev); | 2448 | fw_card_initialize(&ohci->card, &ohci_driver, &dev->dev); |
2448 | 2449 | ||
2449 | ohci_pmac_on(dev); | 2450 | pmac_ohci_on(dev); |
2450 | 2451 | ||
2451 | err = pci_enable_device(dev); | 2452 | err = pci_enable_device(dev); |
2452 | if (err) { | 2453 | if (err) { |
@@ -2580,7 +2581,7 @@ static int __devinit pci_probe(struct pci_dev *dev, | |||
2580 | pci_disable_device(dev); | 2581 | pci_disable_device(dev); |
2581 | fail_free: | 2582 | fail_free: |
2582 | kfree(&ohci->card); | 2583 | kfree(&ohci->card); |
2583 | ohci_pmac_off(dev); | 2584 | pmac_ohci_off(dev); |
2584 | fail: | 2585 | fail: |
2585 | if (err == -ENOMEM) | 2586 | if (err == -ENOMEM) |
2586 | fw_error("Out of memory\n"); | 2587 | fw_error("Out of memory\n"); |
@@ -2623,7 +2624,7 @@ static void pci_remove(struct pci_dev *dev) | |||
2623 | pci_release_region(dev, 0); | 2624 | pci_release_region(dev, 0); |
2624 | pci_disable_device(dev); | 2625 | pci_disable_device(dev); |
2625 | kfree(&ohci->card); | 2626 | kfree(&ohci->card); |
2626 | ohci_pmac_off(dev); | 2627 | pmac_ohci_off(dev); |
2627 | 2628 | ||
2628 | fw_notify("Removed fw-ohci device.\n"); | 2629 | fw_notify("Removed fw-ohci device.\n"); |
2629 | } | 2630 | } |
@@ -2644,7 +2645,7 @@ static int pci_suspend(struct pci_dev *dev, pm_message_t state) | |||
2644 | err = pci_set_power_state(dev, pci_choose_state(dev, state)); | 2645 | err = pci_set_power_state(dev, pci_choose_state(dev, state)); |
2645 | if (err) | 2646 | if (err) |
2646 | fw_error("pci_set_power_state failed with %d\n", err); | 2647 | fw_error("pci_set_power_state failed with %d\n", err); |
2647 | ohci_pmac_off(dev); | 2648 | pmac_ohci_off(dev); |
2648 | 2649 | ||
2649 | return 0; | 2650 | return 0; |
2650 | } | 2651 | } |
@@ -2654,7 +2655,7 @@ static int pci_resume(struct pci_dev *dev) | |||
2654 | struct fw_ohci *ohci = pci_get_drvdata(dev); | 2655 | struct fw_ohci *ohci = pci_get_drvdata(dev); |
2655 | int err; | 2656 | int err; |
2656 | 2657 | ||
2657 | ohci_pmac_on(dev); | 2658 | pmac_ohci_on(dev); |
2658 | pci_set_power_state(dev, PCI_D0); | 2659 | pci_set_power_state(dev, PCI_D0); |
2659 | pci_restore_state(dev); | 2660 | pci_restore_state(dev); |
2660 | err = pci_enable_device(dev); | 2661 | err = pci_enable_device(dev); |