diff options
Diffstat (limited to 'drivers/sbus')
| -rw-r--r-- | drivers/sbus/char/Kconfig | 7 | ||||
| -rw-r--r-- | drivers/sbus/char/bbc_i2c.c | 41 | ||||
| -rw-r--r-- | drivers/sbus/char/display7seg.c | 29 | ||||
| -rw-r--r-- | drivers/sbus/char/envctrl.c | 30 | ||||
| -rw-r--r-- | drivers/sbus/char/flash.c | 23 | ||||
| -rw-r--r-- | drivers/sbus/char/jsflash.c | 5 | ||||
| -rw-r--r-- | drivers/sbus/char/max1617.h | 2 | ||||
| -rw-r--r-- | drivers/sbus/char/openprom.c | 5 | ||||
| -rw-r--r-- | drivers/sbus/char/uctrl.c | 23 |
9 files changed, 46 insertions, 119 deletions
diff --git a/drivers/sbus/char/Kconfig b/drivers/sbus/char/Kconfig index 73cde85d04d..5ba684f73ab 100644 --- a/drivers/sbus/char/Kconfig +++ b/drivers/sbus/char/Kconfig @@ -21,8 +21,7 @@ config OBP_FLASH able to upgrade the OBP firmware, say Y here. config TADPOLE_TS102_UCTRL - tristate "Tadpole TS102 Microcontroller support (EXPERIMENTAL)" - depends on EXPERIMENTAL + tristate "Tadpole TS102 Microcontroller support" help Say Y here to directly support the TS102 Microcontroller interface on the Tadpole Sparcbook 3. This device handles power-management @@ -30,8 +29,8 @@ config TADPOLE_TS102_UCTRL monitors and mice. config SUN_JSFLASH - tristate "JavaStation OS Flash SIMM (EXPERIMENTAL)" - depends on EXPERIMENTAL && SPARC32 + tristate "JavaStation OS Flash SIMM" + depends on SPARC32 help If you say Y here, you will be able to boot from your JavaStation's Flash memory. diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c index 614a5e114a1..c7763e482eb 100644 --- a/drivers/sbus/char/bbc_i2c.c +++ b/drivers/sbus/char/bbc_i2c.c @@ -11,7 +11,6 @@ #include <linux/sched.h> #include <linux/wait.h> #include <linux/delay.h> -#include <linux/init.h> #include <linux/interrupt.h> #include <linux/of.h> #include <linux/of_device.h> @@ -233,13 +232,9 @@ int bbc_i2c_write_buf(struct bbc_i2c_client *client, int ret = 0; while (len > 0) { - int err = bbc_i2c_writeb(client, *buf, off); - - if (err < 0) { - ret = err; + ret = bbc_i2c_writeb(client, *buf, off); + if (ret < 0) break; - } - len--; buf++; off++; @@ -253,11 +248,9 @@ int bbc_i2c_read_buf(struct bbc_i2c_client *client, int ret = 0; while (len > 0) { - int err = bbc_i2c_readb(client, buf, off); - if (err < 0) { - ret = err; + ret = bbc_i2c_readb(client, buf, off); + if (ret < 0) break; - } len--; buf++; off++; @@ -288,7 +281,7 @@ static irqreturn_t bbc_i2c_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static void __init reset_one_i2c(struct bbc_i2c_bus *bp) +static void reset_one_i2c(struct bbc_i2c_bus *bp) { writeb(I2C_PCF_PIN, bp->i2c_control_regs + 0x0); writeb(bp->own, bp->i2c_control_regs + 0x1); @@ -297,7 +290,7 @@ static void __init reset_one_i2c(struct bbc_i2c_bus *bp) writeb(I2C_PCF_IDLE, bp->i2c_control_regs + 0x0); } -static struct bbc_i2c_bus * __init attach_one_i2c(struct platform_device *op, int index) +static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int index) { struct bbc_i2c_bus *bp; struct device_node *dp; @@ -361,8 +354,7 @@ fail: extern int bbc_envctrl_init(struct bbc_i2c_bus *bp); extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp); -static int __devinit bbc_i2c_probe(struct platform_device *op, - const struct of_device_id *match) +static int bbc_i2c_probe(struct platform_device *op) { struct bbc_i2c_bus *bp; int err, index = 0; @@ -386,7 +378,7 @@ static int __devinit bbc_i2c_probe(struct platform_device *op, return err; } -static int __devexit bbc_i2c_remove(struct platform_device *op) +static int bbc_i2c_remove(struct platform_device *op) { struct bbc_i2c_bus *bp = dev_get_drvdata(&op->dev); @@ -413,27 +405,16 @@ static const struct of_device_id bbc_i2c_match[] = { }; MODULE_DEVICE_TABLE(of, bbc_i2c_match); -static struct of_platform_driver bbc_i2c_driver = { +static struct platform_driver bbc_i2c_driver = { .driver = { .name = "bbc_i2c", .owner = THIS_MODULE, .of_match_table = bbc_i2c_match, }, .probe = bbc_i2c_probe, - .remove = __devexit_p(bbc_i2c_remove), + .remove = bbc_i2c_remove, }; -static int __init bbc_i2c_init(void) -{ - return of_register_platform_driver(&bbc_i2c_driver); -} - -static void __exit bbc_i2c_exit(void) -{ - of_unregister_platform_driver(&bbc_i2c_driver); -} - -module_init(bbc_i2c_init); -module_exit(bbc_i2c_exit); +module_platform_driver(bbc_i2c_driver); MODULE_LICENSE("GPL"); diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c index 55f71ea9c41..7c71e7b4feb 100644 --- a/drivers/sbus/char/display7seg.c +++ b/drivers/sbus/char/display7seg.c @@ -9,14 +9,13 @@ #include <linux/fs.h> #include <linux/errno.h> #include <linux/major.h> -#include <linux/init.h> #include <linux/miscdevice.h> #include <linux/ioport.h> /* request_region */ #include <linux/slab.h> #include <linux/mutex.h> #include <linux/of.h> #include <linux/of_device.h> -#include <asm/atomic.h> +#include <linux/atomic.h> #include <asm/uaccess.h> /* put_/get_user */ #include <asm/io.h> @@ -107,7 +106,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg) int error = 0; u8 ireg = 0; - if (D7S_MINOR != iminor(file->f_path.dentry->d_inode)) + if (D7S_MINOR != iminor(file_inode(file))) return -ENODEV; mutex_lock(&d7s_mutex); @@ -150,7 +149,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg) regs |= D7S_FLIP; writeb(regs, p->regs); break; - }; + } mutex_unlock(&d7s_mutex); return error; @@ -171,8 +170,7 @@ static struct miscdevice d7s_miscdev = { .fops = &d7s_fops }; -static int __devinit d7s_probe(struct platform_device *op, - const struct of_device_id *match) +static int d7s_probe(struct platform_device *op) { struct device_node *opts; int err = -EINVAL; @@ -237,7 +235,7 @@ out_free: goto out; } -static int __devexit d7s_remove(struct platform_device *op) +static int d7s_remove(struct platform_device *op) { struct d7s *p = dev_get_drvdata(&op->dev); u8 regs = readb(p->regs); @@ -266,25 +264,14 @@ static const struct of_device_id d7s_match[] = { }; MODULE_DEVICE_TABLE(of, d7s_match); -static struct of_platform_driver d7s_driver = { +static struct platform_driver d7s_driver = { .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, .of_match_table = d7s_match, }, .probe = d7s_probe, - .remove = __devexit_p(d7s_remove), + .remove = d7s_remove, }; -static int __init d7s_init(void) -{ - return of_register_platform_driver(&d7s_driver); -} - -static void __exit d7s_exit(void) -{ - of_unregister_platform_driver(&d7s_driver); -} - -module_init(d7s_init); -module_exit(d7s_exit); +module_platform_driver(d7s_driver); diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index 8ce414e3948..af15a2fdab5 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c @@ -19,7 +19,6 @@ */ #include <linux/module.h> -#include <linux/init.h> #include <linux/kthread.h> #include <linux/delay.h> #include <linux/ioport.h> @@ -353,7 +352,7 @@ static int envctrl_i2c_data_translate(unsigned char data, int translate_type, default: break; - }; + } return len; } @@ -644,7 +643,7 @@ envctrl_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) default: break; - }; + } return ret; } @@ -687,7 +686,7 @@ envctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) default: return -EINVAL; - }; + } return 0; } @@ -947,7 +946,7 @@ static void envctrl_init_i2c_child(struct device_node *dp, default: break; - }; + } } } @@ -1028,8 +1027,7 @@ static int kenvctrld(void *__unused) return 0; } -static int __devinit envctrl_probe(struct platform_device *op, - const struct of_device_id *match) +static int envctrl_probe(struct platform_device *op) { struct device_node *dp; int index, err; @@ -1105,7 +1103,7 @@ out_iounmap: return err; } -static int __devexit envctrl_remove(struct platform_device *op) +static int envctrl_remove(struct platform_device *op) { int index; @@ -1129,26 +1127,16 @@ static const struct of_device_id envctrl_match[] = { }; MODULE_DEVICE_TABLE(of, envctrl_match); -static struct of_platform_driver envctrl_driver = { +static struct platform_driver envctrl_driver = { .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, .of_match_table = envctrl_match, }, .probe = envctrl_probe, - .remove = __devexit_p(envctrl_remove), + .remove = envctrl_remove, }; -static int __init envctrl_init(void) -{ - return of_register_platform_driver(&envctrl_driver); -} - -static void __exit envctrl_exit(void) -{ - of_unregister_platform_driver(&envctrl_driver); -} +module_platform_driver(envctrl_driver); -module_init(envctrl_init); -module_exit(envctrl_exit); MODULE_LICENSE("GPL"); diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 2b4b4b613c4..25c738e9ef1 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c @@ -9,14 +9,12 @@ #include <linux/miscdevice.h> #include <linux/fcntl.h> #include <linux/poll.h> -#include <linux/init.h> #include <linux/mutex.h> #include <linux/spinlock.h> #include <linux/mm.h> #include <linux/of.h> #include <linux/of_device.h> -#include <asm/system.h> #include <asm/uaccess.h> #include <asm/pgtable.h> #include <asm/io.h> @@ -160,8 +158,7 @@ static const struct file_operations flash_fops = { static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops }; -static int __devinit flash_probe(struct platform_device *op, - const struct of_device_id *match) +static int flash_probe(struct platform_device *op) { struct device_node *dp = op->dev.of_node; struct device_node *parent; @@ -192,7 +189,7 @@ static int __devinit flash_probe(struct platform_device *op, return misc_register(&flash_dev); } -static int __devexit flash_remove(struct platform_device *op) +static int flash_remove(struct platform_device *op) { misc_deregister(&flash_dev); @@ -207,26 +204,16 @@ static const struct of_device_id flash_match[] = { }; MODULE_DEVICE_TABLE(of, flash_match); -static struct of_platform_driver flash_driver = { +static struct platform_driver flash_driver = { .driver = { .name = "flash", .owner = THIS_MODULE, .of_match_table = flash_match, }, .probe = flash_probe, - .remove = __devexit_p(flash_remove), + .remove = flash_remove, }; -static int __init flash_init(void) -{ - return of_register_platform_driver(&flash_driver); -} - -static void __exit flash_cleanup(void) -{ - of_unregister_platform_driver(&flash_driver); -} +module_platform_driver(flash_driver); -module_init(flash_init); -module_exit(flash_cleanup); MODULE_LICENSE("GPL"); diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c index e8566224fe4..a40ee1e3748 100644 --- a/drivers/sbus/char/jsflash.c +++ b/drivers/sbus/char/jsflash.c @@ -13,7 +13,7 @@ * TODO: Erase/program both banks of a 8MB SIMM. * * It is anticipated that programming an OS Flash will be a routine - * procedure. In the same time it is exeedingly dangerous because + * procedure. In the same time it is exceedingly dangerous because * a user can program its OBP flash with OS image and effectively * kill the machine. * @@ -207,7 +207,7 @@ static void jsfd_do_request(struct request_queue *q) goto end; } - jsfd_read(req->buffer, jdp->dbase + offset, len); + jsfd_read(bio_data(req->bio), jdp->dbase + offset, len); err = 0; end: if (!__blk_end_request_cur(req, err)) @@ -507,7 +507,6 @@ static int jsflash_init(void) } /* Let us be really paranoid for modifications to probing code. */ - /* extern enum sparc_cpu sparc_cpu_model; */ /* in <asm/system.h> */ if (sparc_cpu_model != sun4m) { /* We must be on sun4m because we use MMU Bypass ASI. */ return -ENXIO; diff --git a/drivers/sbus/char/max1617.h b/drivers/sbus/char/max1617.h index 0bb09c286cb..cd30819a0a3 100644 --- a/drivers/sbus/char/max1617.h +++ b/drivers/sbus/char/max1617.h @@ -6,7 +6,7 @@ #define MAX1617_CPU_TEMP 0x01 /* Processor die temp in C */ #define MAX1617_STATUS 0x02 /* Chip status bits */ -/* Read-only versions of changable registers. */ +/* Read-only versions of changeable registers. */ #define MAX1617_RD_CFG_BYTE 0x03 /* Config register */ #define MAX1617_RD_CVRATE_BYTE 0x04 /* Temp conversion rate */ #define MAX1617_RD_AMB_HIGHLIM 0x05 /* Ambient high limit */ diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 8d6e508222b..5843288f64b 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c @@ -40,7 +40,6 @@ #include <linux/fs.h> #include <asm/oplib.h> #include <asm/prom.h> -#include <asm/system.h> #include <asm/uaccess.h> #include <asm/openpromio.h> #ifdef CONFIG_PCI @@ -223,7 +222,7 @@ static int opromnext(void __user *argp, unsigned int cmd, struct device_node *dp case OPROMSETCUR: default: break; - }; + } } else { /* Sibling of node zero is the root node. */ if (cmd != OPROMNEXT) @@ -589,7 +588,7 @@ static int openprom_bsd_ioctl(struct file * file, default: err = -EINVAL; break; - }; + } mutex_unlock(&openprom_mutex); return err; diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index 1b345be5cc0..b7acafc8509 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c @@ -11,7 +11,6 @@ #include <linux/slab.h> #include <linux/mutex.h> #include <linux/ioport.h> -#include <linux/init.h> #include <linux/miscdevice.h> #include <linux/mm.h> #include <linux/of.h> @@ -19,7 +18,6 @@ #include <asm/openprom.h> #include <asm/oplib.h> -#include <asm/system.h> #include <asm/irq.h> #include <asm/io.h> #include <asm/pgtable.h> @@ -348,8 +346,7 @@ static void uctrl_get_external_status(struct uctrl_driver *driver) } -static int __devinit uctrl_probe(struct platform_device *op, - const struct of_device_id *match) +static int uctrl_probe(struct platform_device *op) { struct uctrl_driver *p; int err = -ENOMEM; @@ -404,7 +401,7 @@ out_free: goto out; } -static int __devexit uctrl_remove(struct platform_device *op) +static int uctrl_remove(struct platform_device *op) { struct uctrl_driver *p = dev_get_drvdata(&op->dev); @@ -425,27 +422,17 @@ static const struct of_device_id uctrl_match[] = { }; MODULE_DEVICE_TABLE(of, uctrl_match); -static struct of_platform_driver uctrl_driver = { +static struct platform_driver uctrl_driver = { .driver = { .name = "uctrl", .owner = THIS_MODULE, .of_match_table = uctrl_match, }, .probe = uctrl_probe, - .remove = __devexit_p(uctrl_remove), + .remove = uctrl_remove, }; -static int __init uctrl_init(void) -{ - return of_register_platform_driver(&uctrl_driver); -} - -static void __exit uctrl_exit(void) -{ - of_unregister_platform_driver(&uctrl_driver); -} +module_platform_driver(uctrl_driver); -module_init(uctrl_init); -module_exit(uctrl_exit); MODULE_LICENSE("GPL"); |
