diff options
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/Kconfig | 2 | ||||
-rw-r--r-- | drivers/pcmcia/Makefile | 2 | ||||
-rw-r--r-- | drivers/pcmcia/cs.c | 8 | ||||
-rw-r--r-- | drivers/pcmcia/ds.c | 20 | ||||
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 5 | ||||
-rw-r--r-- | drivers/pcmcia/pxa2xx_cm_x255.c | 124 | ||||
-rw-r--r-- | drivers/pcmcia/pxa2xx_cm_x270.c | 103 | ||||
-rw-r--r-- | drivers/pcmcia/pxa2xx_cm_x2xx.c | 44 | ||||
-rw-r--r-- | drivers/pcmcia/rsrc_nonstatic.c | 12 | ||||
-rw-r--r-- | drivers/pcmcia/socket_sysfs.c | 18 | ||||
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 23 |
11 files changed, 42 insertions, 319 deletions
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig index d13b8d1a780a..ab53eab635f6 100644 --- a/drivers/pcmcia/Kconfig +++ b/drivers/pcmcia/Kconfig @@ -209,7 +209,7 @@ config PCMCIA_PXA2XX tristate "PXA2xx support" depends on ARM && ARCH_PXA && PCMCIA depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ - || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ + || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI \ || MACH_COLIBRI320 || MACH_H4700) diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index d82c07c4806b..2d5657cfc49c 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile @@ -48,10 +48,8 @@ sa1100_cs-$(CONFIG_SA1100_H3100) += sa1100_h3600.o sa1100_cs-$(CONFIG_SA1100_H3600) += sa1100_h3600.o sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o -pxa2xx_cm_x2xx_cs-y += pxa2xx_cm_x2xx.o pxa2xx_cm_x255.o pxa2xx_cm_x270.o pxa2xx-obj-$(CONFIG_MACH_MAINSTONE) += pxa2xx_mainstone.o pxa2xx-obj-$(CONFIG_PXA_SHARPSL) += pxa2xx_sharpsl.o -pxa2xx-obj-$(CONFIG_MACH_ARMCORE) += pxa2xx_cm_x2xx_cs.o pxa2xx-obj-$(CONFIG_ARCOM_PCMCIA) += pxa2xx_viper.o pxa2xx-obj-$(CONFIG_TRIZEPS_PCMCIA) += pxa2xx_trizeps4.o pxa2xx-obj-$(CONFIG_MACH_PALMTX) += pxa2xx_palmtx.o diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index e211e2619680..f70197154a36 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c @@ -666,18 +666,16 @@ static int pccardd(void *__skt) if (events || sysfs_events) continue; + set_current_state(TASK_INTERRUPTIBLE); if (kthread_should_stop()) break; - set_current_state(TASK_INTERRUPTIBLE); - schedule(); - /* make sure we are running */ - __set_current_state(TASK_RUNNING); - try_to_freeze(); } + /* make sure we are running before we exit */ + __set_current_state(TASK_RUNNING); /* shut down socket, if a device is still present */ if (skt->state & SOCKET_PRESENT) { diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 5bd1b80424e7..ace133b9f7d4 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -998,7 +998,7 @@ static int runtime_resume(struct device *dev) static ssize_t field##_show (struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ - return p_dev->test ? sprintf(buf, format, p_dev->field) : -ENODEV; \ + return p_dev->test ? sysfs_emit(buf, format, p_dev->field) : -ENODEV; \ } \ static DEVICE_ATTR_RO(field); @@ -1006,7 +1006,7 @@ static DEVICE_ATTR_RO(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; \ + return p_dev->field ? sysfs_emit(buf, "%s\n", p_dev->field) : -ENODEV; \ } \ static DEVICE_ATTR_RO(name); @@ -1022,7 +1022,7 @@ 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; + return p_dev->socket ? sysfs_emit(buf, "0x%02x\n", p_dev->func) : -ENODEV; } static DEVICE_ATTR_RO(function); @@ -1030,13 +1030,12 @@ static ssize_t resources_show(struct device *dev, struct device_attribute *attr, char *buf) { struct pcmcia_device *p_dev = to_pcmcia_dev(dev); - char *str = buf; - int i; + int i, at = 0; for (i = 0; i < PCMCIA_NUM_RESOURCES; i++) - str += sprintf(str, "%pr\n", p_dev->resource[i]); + at += sysfs_emit_at(buf, at, "%pr\n", p_dev->resource[i]); - return str - buf; + return at; } static DEVICE_ATTR_RO(resources); @@ -1045,9 +1044,9 @@ static ssize_t pm_state_show(struct device *dev, struct device_attribute *attr, struct pcmcia_device *p_dev = to_pcmcia_dev(dev); if (p_dev->suspended) - return sprintf(buf, "off\n"); + return sysfs_emit(buf, "off\n"); else - return sprintf(buf, "on\n"); + return sysfs_emit(buf, "on\n"); } static ssize_t pm_state_store(struct device *dev, struct device_attribute *attr, @@ -1081,8 +1080,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, hash[i] = crc32(0, p_dev->prod_id[i], strlen(p_dev->prod_id[i])); } - return sprintf(buf, "pcmcia:m%04Xc%04Xf%02Xfn%02Xpfn%02X" - "pa%08Xpb%08Xpc%08Xpd%08X\n", + return sysfs_emit(buf, "pcmcia:m%04Xc%04Xf%02Xfn%02Xpfn%02Xpa%08Xpb%08Xpc%08Xpd%08X\n", p_dev->has_manf_id ? p_dev->manf_id : 0, p_dev->has_card_id ? p_dev->card_id : 0, p_dev->has_func_id ? p_dev->func_id : 0, diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index c1c197292111..d78091e79a0f 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -390,10 +390,9 @@ int pcmcia_release_configuration(struct pcmcia_device *p_dev) * "stale", we don't bother checking the port ranges against the * current socket values. */ -static int pcmcia_release_io(struct pcmcia_device *p_dev) +static void pcmcia_release_io(struct pcmcia_device *p_dev) { struct pcmcia_socket *s = p_dev->socket; - int ret = -EINVAL; config_t *c; mutex_lock(&s->ops_mutex); @@ -412,8 +411,6 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev) out: mutex_unlock(&s->ops_mutex); - - return ret; } /* pcmcia_release_io */ diff --git a/drivers/pcmcia/pxa2xx_cm_x255.c b/drivers/pcmcia/pxa2xx_cm_x255.c deleted file mode 100644 index c0b6b846fbaa..000000000000 --- a/drivers/pcmcia/pxa2xx_cm_x255.c +++ /dev/null @@ -1,124 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * linux/drivers/pcmcia/pxa/pxa_cm_x255.c - * - * Compulab Ltd., 2003, 2007, 2008 - * Mike Rapoport <mike@compulab.co.il> - */ - -#include <linux/platform_device.h> -#include <linux/irq.h> -#include <linux/delay.h> -#include <linux/gpio.h> -#include <linux/export.h> - -#include "soc_common.h" - -#define GPIO_PCMCIA_SKTSEL (54) -#define GPIO_PCMCIA_S0_CD_VALID (16) -#define GPIO_PCMCIA_S1_CD_VALID (17) -#define GPIO_PCMCIA_S0_RDYINT (6) -#define GPIO_PCMCIA_S1_RDYINT (8) -#define GPIO_PCMCIA_RESET (9) - -static int cmx255_pcmcia_hw_init(struct soc_pcmcia_socket *skt) -{ - int ret = gpio_request(GPIO_PCMCIA_RESET, "PCCard reset"); - if (ret) - return ret; - gpio_direction_output(GPIO_PCMCIA_RESET, 0); - - if (skt->nr == 0) { - skt->stat[SOC_STAT_CD].gpio = GPIO_PCMCIA_S0_CD_VALID; - skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD"; - skt->stat[SOC_STAT_RDY].gpio = GPIO_PCMCIA_S0_RDYINT; - skt->stat[SOC_STAT_RDY].name = "PCMCIA0 RDY"; - } else { - skt->stat[SOC_STAT_CD].gpio = GPIO_PCMCIA_S1_CD_VALID; - skt->stat[SOC_STAT_CD].name = "PCMCIA1 CD"; - skt->stat[SOC_STAT_RDY].gpio = GPIO_PCMCIA_S1_RDYINT; - skt->stat[SOC_STAT_RDY].name = "PCMCIA1 RDY"; - } - - return 0; -} - -static void cmx255_pcmcia_shutdown(struct soc_pcmcia_socket *skt) -{ - gpio_free(GPIO_PCMCIA_RESET); -} - - -static void cmx255_pcmcia_socket_state(struct soc_pcmcia_socket *skt, - struct pcmcia_state *state) -{ - state->vs_3v = 0; - state->vs_Xv = 0; -} - - -static int cmx255_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, - const socket_state_t *state) -{ - switch (skt->nr) { - case 0: - if (state->flags & SS_RESET) { - gpio_set_value(GPIO_PCMCIA_SKTSEL, 0); - udelay(1); - gpio_set_value(GPIO_PCMCIA_RESET, 1); - udelay(10); - gpio_set_value(GPIO_PCMCIA_RESET, 0); - } - break; - case 1: - if (state->flags & SS_RESET) { - gpio_set_value(GPIO_PCMCIA_SKTSEL, 1); - udelay(1); - gpio_set_value(GPIO_PCMCIA_RESET, 1); - udelay(10); - gpio_set_value(GPIO_PCMCIA_RESET, 0); - } - break; - } - - return 0; -} - -static struct pcmcia_low_level cmx255_pcmcia_ops __initdata = { - .owner = THIS_MODULE, - .hw_init = cmx255_pcmcia_hw_init, - .hw_shutdown = cmx255_pcmcia_shutdown, - .socket_state = cmx255_pcmcia_socket_state, - .configure_socket = cmx255_pcmcia_configure_socket, - .nr = 1, -}; - -static struct platform_device *cmx255_pcmcia_device; - -int __init cmx255_pcmcia_init(void) -{ - int ret; - - cmx255_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); - - if (!cmx255_pcmcia_device) - return -ENOMEM; - - ret = platform_device_add_data(cmx255_pcmcia_device, &cmx255_pcmcia_ops, - sizeof(cmx255_pcmcia_ops)); - - if (ret == 0) { - printk(KERN_INFO "Registering cm-x255 PCMCIA interface.\n"); - ret = platform_device_add(cmx255_pcmcia_device); - } - - if (ret) - platform_device_put(cmx255_pcmcia_device); - - return ret; -} - -void __exit cmx255_pcmcia_exit(void) -{ - platform_device_unregister(cmx255_pcmcia_device); -} diff --git a/drivers/pcmcia/pxa2xx_cm_x270.c b/drivers/pcmcia/pxa2xx_cm_x270.c deleted file mode 100644 index 36e35da5f887..000000000000 --- a/drivers/pcmcia/pxa2xx_cm_x270.c +++ /dev/null @@ -1,103 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * linux/drivers/pcmcia/pxa/pxa_cm_x270.c - * - * Compulab Ltd., 2003, 2007, 2008 - * Mike Rapoport <mike@compulab.co.il> - */ - -#include <linux/platform_device.h> -#include <linux/irq.h> -#include <linux/delay.h> -#include <linux/gpio.h> -#include <linux/export.h> - -#include "soc_common.h" - -#define GPIO_PCMCIA_S0_CD_VALID (84) -#define GPIO_PCMCIA_S0_RDYINT (82) -#define GPIO_PCMCIA_RESET (53) - -static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) -{ - int ret = gpio_request(GPIO_PCMCIA_RESET, "PCCard reset"); - if (ret) - return ret; - gpio_direction_output(GPIO_PCMCIA_RESET, 0); - - skt->stat[SOC_STAT_CD].gpio = GPIO_PCMCIA_S0_CD_VALID; - skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD"; - skt->stat[SOC_STAT_RDY].gpio = GPIO_PCMCIA_S0_RDYINT; - skt->stat[SOC_STAT_RDY].name = "PCMCIA0 RDY"; - - return ret; -} - -static void cmx270_pcmcia_shutdown(struct soc_pcmcia_socket *skt) -{ - gpio_free(GPIO_PCMCIA_RESET); -} - - -static void cmx270_pcmcia_socket_state(struct soc_pcmcia_socket *skt, - struct pcmcia_state *state) -{ - state->vs_3v = 0; - state->vs_Xv = 0; -} - - -static int cmx270_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, - const socket_state_t *state) -{ - switch (skt->nr) { - case 0: - if (state->flags & SS_RESET) { - gpio_set_value(GPIO_PCMCIA_RESET, 1); - udelay(10); - gpio_set_value(GPIO_PCMCIA_RESET, 0); - } - break; - } - - return 0; -} - -static struct pcmcia_low_level cmx270_pcmcia_ops __initdata = { - .owner = THIS_MODULE, - .hw_init = cmx270_pcmcia_hw_init, - .hw_shutdown = cmx270_pcmcia_shutdown, - .socket_state = cmx270_pcmcia_socket_state, - .configure_socket = cmx270_pcmcia_configure_socket, - .nr = 1, -}; - -static struct platform_device *cmx270_pcmcia_device; - -int __init cmx270_pcmcia_init(void) -{ - int ret; - - cmx270_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); - - if (!cmx270_pcmcia_device) - return -ENOMEM; - - ret = platform_device_add_data(cmx270_pcmcia_device, &cmx270_pcmcia_ops, - sizeof(cmx270_pcmcia_ops)); - - if (ret == 0) { - printk(KERN_INFO "Registering cm-x270 PCMCIA interface.\n"); - ret = platform_device_add(cmx270_pcmcia_device); - } - - if (ret) - platform_device_put(cmx270_pcmcia_device); - - return ret; -} - -void __exit cmx270_pcmcia_exit(void) -{ - platform_device_unregister(cmx270_pcmcia_device); -} diff --git a/drivers/pcmcia/pxa2xx_cm_x2xx.c b/drivers/pcmcia/pxa2xx_cm_x2xx.c deleted file mode 100644 index 14eae238131d..000000000000 --- a/drivers/pcmcia/pxa2xx_cm_x2xx.c +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * linux/drivers/pcmcia/pxa/pxa_cm_x2xx.c - * - * Compulab Ltd., 2003, 2007, 2008 - * Mike Rapoport <mike@compulab.co.il> - */ - -#include <linux/module.h> - -#include <asm/mach-types.h> -#include <mach/hardware.h> - -int cmx255_pcmcia_init(void); -int cmx270_pcmcia_init(void); -void cmx255_pcmcia_exit(void); -void cmx270_pcmcia_exit(void); - -static int __init cmx2xx_pcmcia_init(void) -{ - int ret = -ENODEV; - - if (machine_is_armcore() && cpu_is_pxa25x()) - ret = cmx255_pcmcia_init(); - else if (machine_is_armcore() && cpu_is_pxa27x()) - ret = cmx270_pcmcia_init(); - - return ret; -} - -static void __exit cmx2xx_pcmcia_exit(void) -{ - if (machine_is_armcore() && cpu_is_pxa25x()) - cmx255_pcmcia_exit(); - else if (machine_is_armcore() && cpu_is_pxa27x()) - cmx270_pcmcia_exit(); -} - -module_init(cmx2xx_pcmcia_init); -module_exit(cmx2xx_pcmcia_exit); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Mike Rapoport <mike@compulab.co.il>"); -MODULE_DESCRIPTION("CM-x2xx PCMCIA driver"); diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index bb15a8bdbaab..6b6c578b5f92 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c @@ -690,6 +690,9 @@ static struct resource *__nonstatic_find_io_region(struct pcmcia_socket *s, unsigned long min = base; int ret; + if (!res) + return NULL; + data.mask = align - 1; data.offset = base & data.mask; data.map = &s_data->io_db; @@ -809,6 +812,9 @@ static struct resource *nonstatic_find_mem_region(u_long base, u_long num, unsigned long min, max; int ret, i, j; + if (!res) + return NULL; + low = low || !(s->features & SS_CAP_PAGE_REGS); data.mask = align - 1; @@ -1076,7 +1082,7 @@ static ssize_t show_io_db(struct device *dev, for (p = data->io_db.next; p != &data->io_db; p = p->next) { if (ret > (PAGE_SIZE - 10)) continue; - ret += scnprintf(&buf[ret], (PAGE_SIZE - ret - 1), + ret += sysfs_emit_at(buf, ret, "0x%08lx - 0x%08lx\n", ((unsigned long) p->base), ((unsigned long) p->base + p->num - 1)); @@ -1133,7 +1139,7 @@ static ssize_t show_mem_db(struct device *dev, p = p->next) { if (ret > (PAGE_SIZE - 10)) continue; - ret += scnprintf(&buf[ret], (PAGE_SIZE - ret - 1), + ret += sysfs_emit_at(buf, ret, "0x%08lx - 0x%08lx\n", ((unsigned long) p->base), ((unsigned long) p->base + p->num - 1)); @@ -1142,7 +1148,7 @@ static ssize_t show_mem_db(struct device *dev, for (p = data->mem_db.next; p != &data->mem_db; p = p->next) { if (ret > (PAGE_SIZE - 10)) continue; - ret += scnprintf(&buf[ret], (PAGE_SIZE - ret - 1), + ret += sysfs_emit_at(buf, ret, "0x%08lx - 0x%08lx\n", ((unsigned long) p->base), ((unsigned long) p->base + p->num - 1)); diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c index d1b220a1e1ab..c7a906664c36 100644 --- a/drivers/pcmcia/socket_sysfs.c +++ b/drivers/pcmcia/socket_sysfs.c @@ -38,8 +38,8 @@ static ssize_t pccard_show_type(struct device *dev, struct device_attribute *att if (!(s->state & SOCKET_PRESENT)) return -ENODEV; if (s->state & SOCKET_CARDBUS) - return sprintf(buf, "32-bit\n"); - return sprintf(buf, "16-bit\n"); + return sysfs_emit(buf, "32-bit\n"); + return sysfs_emit(buf, "16-bit\n"); } static DEVICE_ATTR(card_type, 0444, pccard_show_type, NULL); @@ -51,9 +51,9 @@ static ssize_t pccard_show_voltage(struct device *dev, struct device_attribute * if (!(s->state & SOCKET_PRESENT)) return -ENODEV; if (s->socket.Vcc) - return sprintf(buf, "%d.%dV\n", s->socket.Vcc / 10, + return sysfs_emit(buf, "%d.%dV\n", s->socket.Vcc / 10, s->socket.Vcc % 10); - return sprintf(buf, "X.XV\n"); + return sysfs_emit(buf, "X.XV\n"); } static DEVICE_ATTR(card_voltage, 0444, pccard_show_voltage, NULL); @@ -63,7 +63,7 @@ static ssize_t pccard_show_vpp(struct device *dev, struct device_attribute *attr struct pcmcia_socket *s = to_socket(dev); if (!(s->state & SOCKET_PRESENT)) return -ENODEV; - return sprintf(buf, "%d.%dV\n", s->socket.Vpp / 10, s->socket.Vpp % 10); + return sysfs_emit(buf, "%d.%dV\n", s->socket.Vpp / 10, s->socket.Vpp % 10); } static DEVICE_ATTR(card_vpp, 0444, pccard_show_vpp, NULL); @@ -73,7 +73,7 @@ static ssize_t pccard_show_vcc(struct device *dev, struct device_attribute *attr struct pcmcia_socket *s = to_socket(dev); if (!(s->state & SOCKET_PRESENT)) return -ENODEV; - return sprintf(buf, "%d.%dV\n", s->socket.Vcc / 10, s->socket.Vcc % 10); + return sysfs_emit(buf, "%d.%dV\n", s->socket.Vcc / 10, s->socket.Vcc % 10); } static DEVICE_ATTR(card_vcc, 0444, pccard_show_vcc, NULL); @@ -98,7 +98,7 @@ static ssize_t pccard_show_card_pm_state(struct device *dev, char *buf) { struct pcmcia_socket *s = to_socket(dev); - return sprintf(buf, "%s\n", s->state & SOCKET_SUSPEND ? "off" : "on"); + return sysfs_emit(buf, "%s\n", s->state & SOCKET_SUSPEND ? "off" : "on"); } static ssize_t pccard_store_card_pm_state(struct device *dev, @@ -145,7 +145,7 @@ static ssize_t pccard_show_irq_mask(struct device *dev, char *buf) { struct pcmcia_socket *s = to_socket(dev); - return sprintf(buf, "0x%04x\n", s->irq_mask); + return sysfs_emit(buf, "0x%04x\n", s->irq_mask); } static ssize_t pccard_store_irq_mask(struct device *dev, @@ -177,7 +177,7 @@ static ssize_t pccard_show_resource(struct device *dev, struct device_attribute *attr, char *buf) { struct pcmcia_socket *s = to_socket(dev); - return sprintf(buf, "%s\n", s->resource_setup_done ? "yes" : "no"); + return sysfs_emit(buf, "%s\n", s->resource_setup_done ? "yes" : "no"); } static ssize_t pccard_store_resource(struct device *dev, diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 84bfc0e85d6b..837877daed62 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -144,6 +144,7 @@ static inline u8 exca_readb(struct yenta_socket *socket, unsigned reg) return val; } +/* static inline u8 exca_readw(struct yenta_socket *socket, unsigned reg) { u16 val; @@ -152,6 +153,7 @@ static inline u8 exca_readw(struct yenta_socket *socket, unsigned reg) debug("%04x %04x\n", socket, reg, val); return val; } +*/ static inline void exca_writeb(struct yenta_socket *socket, unsigned reg, u8 val) { @@ -176,16 +178,16 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri struct yenta_socket *socket = dev_get_drvdata(yentadev); int offset = 0, i; - offset = snprintf(buf, PAGE_SIZE, "CB registers:"); + offset = sysfs_emit(buf, "CB registers:"); for (i = 0; i < 0x24; i += 4) { unsigned val; if (!(i & 15)) - offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i); + offset += sysfs_emit_at(buf, offset, "\n%02x:", i); val = cb_readl(socket, i); - offset += scnprintf(buf + offset, PAGE_SIZE - offset, " %08x", val); + offset += sysfs_emit_at(buf, offset, " %08x", val); } - offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n\nExCA registers:"); + offset += sysfs_emit_at(buf, offset, "\n\nExCA registers:"); for (i = 0; i < 0x45; i++) { unsigned char val; if (!(i & 7)) { @@ -193,12 +195,12 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri memcpy(buf + offset, " -", 2); offset += 2; } else - offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i); + offset += sysfs_emit_at(buf, offset, "\n%02x:", i); } val = exca_readb(socket, i); - offset += scnprintf(buf + offset, PAGE_SIZE - offset, " %02x", val); + offset += sysfs_emit_at(buf, offset, " %02x", val); } - buf[offset++] = '\n'; + sysfs_emit_at(buf, offset, "\n"); return offset; } @@ -1342,12 +1344,7 @@ static int yenta_dev_resume_noirq(struct device *dev) } static const struct dev_pm_ops yenta_pm_ops = { - .suspend_noirq = yenta_dev_suspend_noirq, - .resume_noirq = yenta_dev_resume_noirq, - .freeze_noirq = yenta_dev_suspend_noirq, - .thaw_noirq = yenta_dev_resume_noirq, - .poweroff_noirq = yenta_dev_suspend_noirq, - .restore_noirq = yenta_dev_resume_noirq, + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(yenta_dev_suspend_noirq, yenta_dev_resume_noirq) }; #define YENTA_PM_OPS (¥ta_pm_ops) |