diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /drivers/pcmcia | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/at91_cf.c | 11 | ||||
-rw-r--r-- | drivers/pcmcia/ds.c | 65 | ||||
-rw-r--r-- | drivers/pcmcia/electra_cf.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/m8xx_pcmcia.c | 2 | ||||
-rw-r--r-- | drivers/pcmcia/pd6729.c | 13 | ||||
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 16 |
6 files changed, 59 insertions, 50 deletions
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index de24232..b8f5acf 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -245,7 +245,7 @@ static int at91_cf_dt_init(struct platform_device *pdev) } #endif -static int at91_cf_probe(struct platform_device *pdev) +static int __init at91_cf_probe(struct platform_device *pdev) { struct at91_cf_socket *cf; struct at91_cf_data *board = pdev->dev.platform_data; @@ -354,7 +354,7 @@ fail0a: return status; } -static int at91_cf_remove(struct platform_device *pdev) +static int __exit at91_cf_remove(struct platform_device *pdev) { struct at91_cf_socket *cf = platform_get_drvdata(pdev); @@ -404,13 +404,14 @@ static struct platform_driver at91_cf_driver = { .owner = THIS_MODULE, .of_match_table = of_match_ptr(at91_cf_dt_ids), }, - .probe = at91_cf_probe, - .remove = at91_cf_remove, + .remove = __exit_p(at91_cf_remove), .suspend = at91_cf_suspend, .resume = at91_cf_resume, }; -module_platform_driver(at91_cf_driver); +/*--------------------------------------------------------------------------*/ + +module_platform_driver_probe(at91_cf_driver, at91_cf_probe); MODULE_DESCRIPTION("AT91 Compact Flash Driver"); MODULE_AUTHOR("David Brownell"); diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 757119b..2deacbb 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -992,17 +992,16 @@ static ssize_t field##_show (struct device *dev, struct device_attribute *attr, { \ struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ return p_dev->test ? sprintf(buf, format, p_dev->field) : -ENODEV; \ -} \ -static DEVICE_ATTR_RO(field); +} #define pcmcia_device_stringattr(name, field) \ static ssize_t name##_show (struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ return p_dev->field ? sprintf(buf, "%s\n", p_dev->field) : -ENODEV; \ -} \ -static DEVICE_ATTR_RO(name); +} +pcmcia_device_attr(func, socket, "0x%02x\n"); pcmcia_device_attr(func_id, has_func_id, "0x%02x\n"); pcmcia_device_attr(manf_id, has_manf_id, "0x%04x\n"); pcmcia_device_attr(card_id, has_card_id, "0x%04x\n"); @@ -1011,16 +1010,8 @@ pcmcia_device_stringattr(prod_id2, prod_id[1]); pcmcia_device_stringattr(prod_id3, prod_id[2]); pcmcia_device_stringattr(prod_id4, prod_id[3]); -static ssize_t function_show(struct device *dev, struct device_attribute *attr, - char *buf) -{ - struct pcmcia_device *p_dev = to_pcmcia_dev(dev); - return p_dev->socket ? sprintf(buf, "0x%02x\n", p_dev->func) : -ENODEV; -} -static DEVICE_ATTR_RO(function); - -static ssize_t resources_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t pcmcia_show_resources(struct device *dev, + struct device_attribute *attr, char *buf) { struct pcmcia_device *p_dev = to_pcmcia_dev(dev); char *str = buf; @@ -1031,9 +1022,8 @@ static ssize_t resources_show(struct device *dev, return str - buf; } -static DEVICE_ATTR_RO(resources); -static ssize_t pm_state_show(struct device *dev, struct device_attribute *attr, char *buf) +static ssize_t pcmcia_show_pm_state(struct device *dev, struct device_attribute *attr, char *buf) { struct pcmcia_device *p_dev = to_pcmcia_dev(dev); @@ -1043,8 +1033,8 @@ static ssize_t pm_state_show(struct device *dev, struct device_attribute *attr, return sprintf(buf, "on\n"); } -static ssize_t pm_state_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t pcmcia_store_pm_state(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) { struct pcmcia_device *p_dev = to_pcmcia_dev(dev); int ret = 0; @@ -1059,7 +1049,7 @@ static ssize_t pm_state_store(struct device *dev, struct device_attribute *attr, return ret ? ret : count; } -static DEVICE_ATTR_RW(pm_state); + static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -1082,9 +1072,8 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, p_dev->func, p_dev->device_no, hash[0], hash[1], hash[2], hash[3]); } -static DEVICE_ATTR_RO(modalias); -static ssize_t allow_func_id_match_store(struct device *dev, +static ssize_t pcmcia_store_allow_func_id_match(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct pcmcia_device *p_dev = to_pcmcia_dev(dev); @@ -1099,24 +1088,22 @@ static ssize_t allow_func_id_match_store(struct device *dev, return count; } -static DEVICE_ATTR_WO(allow_func_id_match); - -static struct attribute *pcmcia_dev_attrs[] = { - &dev_attr_resources.attr, - &dev_attr_pm_state.attr, - &dev_attr_function.attr, - &dev_attr_func_id.attr, - &dev_attr_manf_id.attr, - &dev_attr_card_id.attr, - &dev_attr_prod_id1.attr, - &dev_attr_prod_id2.attr, - &dev_attr_prod_id3.attr, - &dev_attr_prod_id4.attr, - &dev_attr_modalias.attr, - &dev_attr_allow_func_id_match.attr, - NULL, + +static struct device_attribute pcmcia_dev_attrs[] = { + __ATTR(function, 0444, func_show, NULL), + __ATTR(pm_state, 0644, pcmcia_show_pm_state, pcmcia_store_pm_state), + __ATTR(resources, 0444, pcmcia_show_resources, NULL), + __ATTR_RO(func_id), + __ATTR_RO(manf_id), + __ATTR_RO(card_id), + __ATTR_RO(prod_id1), + __ATTR_RO(prod_id2), + __ATTR_RO(prod_id3), + __ATTR_RO(prod_id4), + __ATTR_RO(modalias), + __ATTR(allow_func_id_match, 0200, NULL, pcmcia_store_allow_func_id_match), + __ATTR_NULL, }; -ATTRIBUTE_GROUPS(pcmcia_dev); /* PM support, also needed for reset */ @@ -1402,7 +1389,7 @@ struct bus_type pcmcia_bus_type = { .name = "pcmcia", .uevent = pcmcia_bus_uevent, .match = pcmcia_bus_match, - .dev_groups = pcmcia_dev_groups, + .dev_attrs = pcmcia_dev_attrs, .probe = pcmcia_device_probe, .remove = pcmcia_device_remove, .suspend = pcmcia_dev_suspend, diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c index 1b206ea..a007321a 100644 --- a/drivers/pcmcia/electra_cf.c +++ b/drivers/pcmcia/electra_cf.c @@ -30,8 +30,6 @@ #include <linux/interrupt.h> #include <linux/mm.h> #include <linux/vmalloc.h> -#include <linux/of_address.h> -#include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/slab.h> diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c index 182034d..18c0d8d 100644 --- a/drivers/pcmcia/m8xx_pcmcia.c +++ b/drivers/pcmcia/m8xx_pcmcia.c @@ -48,9 +48,7 @@ #include <linux/interrupt.h> #include <linux/fsl_devices.h> #include <linux/bitops.h> -#include <linux/of_address.h> #include <linux/of_device.h> -#include <linux/of_irq.h> #include <linux/of_platform.h> #include <asm/io.h> diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index 622dd6f..a4c16ee 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c @@ -777,4 +777,15 @@ static struct pci_driver pd6729_pci_driver = { .remove = pd6729_pci_remove, }; -module_pci_driver(pd6729_pci_driver); +static int pd6729_module_init(void) +{ + return pci_register_driver(&pd6729_pci_driver); +} + +static void pd6729_module_exit(void) +{ + pci_unregister_driver(&pd6729_pci_driver); +} + +module_init(pd6729_module_init); +module_exit(pd6729_module_exit); diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index dc18a3a..6b4ff09 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -1439,6 +1439,20 @@ static struct pci_driver yenta_cardbus_driver = { .driver.pm = YENTA_PM_OPS, }; -module_pci_driver(yenta_cardbus_driver); + +static int __init yenta_socket_init(void) +{ + return pci_register_driver(¥ta_cardbus_driver); +} + + +static void __exit yenta_socket_exit(void) +{ + pci_unregister_driver(¥ta_cardbus_driver); +} + + +module_init(yenta_socket_init); +module_exit(yenta_socket_exit); MODULE_LICENSE("GPL"); |