diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-13 14:19:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-13 14:19:24 -0500 |
commit | cf09112d160e6db21ff8427ce696f819b957423b (patch) | |
tree | 9e5587835c33b4e748f3f6955d3d273cca93016d | |
parent | 1c5ff2ab7bba6757e7663302c5905e6404de324a (diff) | |
parent | bb0dcebef99fd024c0fb2703179bc7d1fd5ee995 (diff) |
Merge tag 'for-linus-4.5' of git://git.code.sf.net/p/openipmi/linux-ipmi
Pull ipmi updates from Corey Minyard:
"Some minor changes that have been in linux-next for a while"
* tag 'for-linus-4.5' of git://git.code.sf.net/p/openipmi/linux-ipmi:
ipmi: Remove unnecessary pci_disable_device.
char: ipmi: Drop owner assignment from i2c_driver
ipmi: constify some struct and char arrays
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 7 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 28 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_ssif.c | 1 |
3 files changed, 20 insertions, 16 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index e3536da05c88..94fb407d8561 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -472,9 +472,10 @@ static DEFINE_MUTEX(smi_watchers_mutex); | |||
472 | #define ipmi_get_stat(intf, stat) \ | 472 | #define ipmi_get_stat(intf, stat) \ |
473 | ((unsigned int) atomic_read(&(intf)->stats[IPMI_STAT_ ## stat])) | 473 | ((unsigned int) atomic_read(&(intf)->stats[IPMI_STAT_ ## stat])) |
474 | 474 | ||
475 | static char *addr_src_to_str[] = { "invalid", "hotmod", "hardcoded", "SPMI", | 475 | static const char * const addr_src_to_str[] = { |
476 | "ACPI", "SMBIOS", "PCI", | 476 | "invalid", "hotmod", "hardcoded", "SPMI", "ACPI", "SMBIOS", "PCI", |
477 | "device-tree", "default" }; | 477 | "device-tree", "default" |
478 | }; | ||
478 | 479 | ||
479 | const char *ipmi_addr_src_to_str(enum ipmi_addr_src src) | 480 | const char *ipmi_addr_src_to_str(enum ipmi_addr_src src) |
480 | { | 481 | { |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 4cc72fa017c7..9fda22e3387e 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -105,7 +105,8 @@ enum si_intf_state { | |||
105 | enum si_type { | 105 | enum si_type { |
106 | SI_KCS, SI_SMIC, SI_BT | 106 | SI_KCS, SI_SMIC, SI_BT |
107 | }; | 107 | }; |
108 | static char *si_to_str[] = { "kcs", "smic", "bt" }; | 108 | |
109 | static const char * const si_to_str[] = { "kcs", "smic", "bt" }; | ||
109 | 110 | ||
110 | #define DEVICE_NAME "ipmi_si" | 111 | #define DEVICE_NAME "ipmi_si" |
111 | 112 | ||
@@ -1341,7 +1342,7 @@ static unsigned int num_slave_addrs; | |||
1341 | 1342 | ||
1342 | #define IPMI_IO_ADDR_SPACE 0 | 1343 | #define IPMI_IO_ADDR_SPACE 0 |
1343 | #define IPMI_MEM_ADDR_SPACE 1 | 1344 | #define IPMI_MEM_ADDR_SPACE 1 |
1344 | static char *addr_space_to_str[] = { "i/o", "mem" }; | 1345 | static const char * const addr_space_to_str[] = { "i/o", "mem" }; |
1345 | 1346 | ||
1346 | static int hotmod_handler(const char *val, struct kernel_param *kp); | 1347 | static int hotmod_handler(const char *val, struct kernel_param *kp); |
1347 | 1348 | ||
@@ -1723,27 +1724,31 @@ static int mem_setup(struct smi_info *info) | |||
1723 | */ | 1724 | */ |
1724 | enum hotmod_op { HM_ADD, HM_REMOVE }; | 1725 | enum hotmod_op { HM_ADD, HM_REMOVE }; |
1725 | struct hotmod_vals { | 1726 | struct hotmod_vals { |
1726 | char *name; | 1727 | const char *name; |
1727 | int val; | 1728 | const int val; |
1728 | }; | 1729 | }; |
1729 | static struct hotmod_vals hotmod_ops[] = { | 1730 | |
1731 | static const struct hotmod_vals hotmod_ops[] = { | ||
1730 | { "add", HM_ADD }, | 1732 | { "add", HM_ADD }, |
1731 | { "remove", HM_REMOVE }, | 1733 | { "remove", HM_REMOVE }, |
1732 | { NULL } | 1734 | { NULL } |
1733 | }; | 1735 | }; |
1734 | static struct hotmod_vals hotmod_si[] = { | 1736 | |
1737 | static const struct hotmod_vals hotmod_si[] = { | ||
1735 | { "kcs", SI_KCS }, | 1738 | { "kcs", SI_KCS }, |
1736 | { "smic", SI_SMIC }, | 1739 | { "smic", SI_SMIC }, |
1737 | { "bt", SI_BT }, | 1740 | { "bt", SI_BT }, |
1738 | { NULL } | 1741 | { NULL } |
1739 | }; | 1742 | }; |
1740 | static struct hotmod_vals hotmod_as[] = { | 1743 | |
1744 | static const struct hotmod_vals hotmod_as[] = { | ||
1741 | { "mem", IPMI_MEM_ADDR_SPACE }, | 1745 | { "mem", IPMI_MEM_ADDR_SPACE }, |
1742 | { "i/o", IPMI_IO_ADDR_SPACE }, | 1746 | { "i/o", IPMI_IO_ADDR_SPACE }, |
1743 | { NULL } | 1747 | { NULL } |
1744 | }; | 1748 | }; |
1745 | 1749 | ||
1746 | static int parse_str(struct hotmod_vals *v, int *val, char *name, char **curr) | 1750 | static int parse_str(const struct hotmod_vals *v, int *val, char *name, |
1751 | char **curr) | ||
1747 | { | 1752 | { |
1748 | char *s; | 1753 | char *s; |
1749 | int i; | 1754 | int i; |
@@ -2554,7 +2559,6 @@ static void ipmi_pci_remove(struct pci_dev *pdev) | |||
2554 | { | 2559 | { |
2555 | struct smi_info *info = pci_get_drvdata(pdev); | 2560 | struct smi_info *info = pci_get_drvdata(pdev); |
2556 | cleanup_one_si(info); | 2561 | cleanup_one_si(info); |
2557 | pci_disable_device(pdev); | ||
2558 | } | 2562 | } |
2559 | 2563 | ||
2560 | static const struct pci_device_id ipmi_pci_devices[] = { | 2564 | static const struct pci_device_id ipmi_pci_devices[] = { |
@@ -2870,7 +2874,7 @@ static int ipmi_parisc_remove(struct parisc_device *dev) | |||
2870 | return 0; | 2874 | return 0; |
2871 | } | 2875 | } |
2872 | 2876 | ||
2873 | static struct parisc_device_id ipmi_parisc_tbl[] = { | 2877 | static const struct parisc_device_id ipmi_parisc_tbl[] = { |
2874 | { HPHW_MC, HVERSION_REV_ANY_ID, 0x004, 0xC0 }, | 2878 | { HPHW_MC, HVERSION_REV_ANY_ID, 0x004, 0xC0 }, |
2875 | { 0, } | 2879 | { 0, } |
2876 | }; | 2880 | }; |
@@ -3444,8 +3448,8 @@ static inline void wait_for_timer_and_thread(struct smi_info *smi_info) | |||
3444 | 3448 | ||
3445 | static const struct ipmi_default_vals | 3449 | static const struct ipmi_default_vals |
3446 | { | 3450 | { |
3447 | int type; | 3451 | const int type; |
3448 | int port; | 3452 | const int port; |
3449 | } ipmi_defaults[] = | 3453 | } ipmi_defaults[] = |
3450 | { | 3454 | { |
3451 | { .type = SI_KCS, .port = 0xca2 }, | 3455 | { .type = SI_KCS, .port = 0xca2 }, |
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index 90e624662257..5f1c3d08ba65 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c | |||
@@ -1959,7 +1959,6 @@ MODULE_DEVICE_TABLE(i2c, ssif_id); | |||
1959 | static struct i2c_driver ssif_i2c_driver = { | 1959 | static struct i2c_driver ssif_i2c_driver = { |
1960 | .class = I2C_CLASS_HWMON, | 1960 | .class = I2C_CLASS_HWMON, |
1961 | .driver = { | 1961 | .driver = { |
1962 | .owner = THIS_MODULE, | ||
1963 | .name = DEVICE_NAME | 1962 | .name = DEVICE_NAME |
1964 | }, | 1963 | }, |
1965 | .probe = ssif_probe, | 1964 | .probe = ssif_probe, |