diff options
Diffstat (limited to 'drivers/sbus/char')
-rw-r--r-- | drivers/sbus/char/envctrl.c | 8 | ||||
-rw-r--r-- | drivers/sbus/char/flash.c | 2 | ||||
-rw-r--r-- | drivers/sbus/char/openprom.c | 25 | ||||
-rw-r--r-- | drivers/sbus/char/vfc_dev.c | 3 |
4 files changed, 18 insertions, 20 deletions
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index 2cea4f5d2084..f2be2ead8742 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c | |||
@@ -726,7 +726,7 @@ static struct miscdevice envctrl_dev = { | |||
726 | * Return: None. | 726 | * Return: None. |
727 | */ | 727 | */ |
728 | static void envctrl_set_mon(struct i2c_child_t *pchild, | 728 | static void envctrl_set_mon(struct i2c_child_t *pchild, |
729 | char *chnl_desc, | 729 | const char *chnl_desc, |
730 | int chnl_no) | 730 | int chnl_no) |
731 | { | 731 | { |
732 | /* Firmware only has temperature type. It does not distinguish | 732 | /* Firmware only has temperature type. It does not distinguish |
@@ -763,8 +763,8 @@ static void envctrl_set_mon(struct i2c_child_t *pchild, | |||
763 | static void envctrl_init_adc(struct i2c_child_t *pchild, struct device_node *dp) | 763 | static void envctrl_init_adc(struct i2c_child_t *pchild, struct device_node *dp) |
764 | { | 764 | { |
765 | int i = 0, len; | 765 | int i = 0, len; |
766 | char *pos; | 766 | const char *pos; |
767 | unsigned int *pval; | 767 | const unsigned int *pval; |
768 | 768 | ||
769 | /* Firmware describe channels into a stream separated by a '\0'. */ | 769 | /* Firmware describe channels into a stream separated by a '\0'. */ |
770 | pos = of_get_property(dp, "channels-description", &len); | 770 | pos = of_get_property(dp, "channels-description", &len); |
@@ -859,7 +859,7 @@ static void envctrl_init_i2c_child(struct linux_ebus_child *edev_child, | |||
859 | { | 859 | { |
860 | int len, i, tbls_size = 0; | 860 | int len, i, tbls_size = 0; |
861 | struct device_node *dp = edev_child->prom_node; | 861 | struct device_node *dp = edev_child->prom_node; |
862 | void *pval; | 862 | const void *pval; |
863 | 863 | ||
864 | /* Get device address. */ | 864 | /* Get device address. */ |
865 | pval = of_get_property(dp, "reg", &len); | 865 | pval = of_get_property(dp, "reg", &len); |
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index 6e99507aeb12..262f01e68592 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c | |||
@@ -190,7 +190,7 @@ static int __init flash_init(void) | |||
190 | } | 190 | } |
191 | if (!sdev) { | 191 | if (!sdev) { |
192 | #ifdef CONFIG_PCI | 192 | #ifdef CONFIG_PCI |
193 | struct linux_prom_registers *ebus_regs; | 193 | const struct linux_prom_registers *ebus_regs; |
194 | 194 | ||
195 | for_each_ebus(ebus) { | 195 | for_each_ebus(ebus) { |
196 | for_each_ebusdev(edev, ebus) { | 196 | for_each_ebusdev(edev, ebus) { |
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index eec28c142a59..fbfeb89a6f32 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include <asm/openpromio.h> | 44 | #include <asm/openpromio.h> |
45 | #ifdef CONFIG_PCI | 45 | #ifdef CONFIG_PCI |
46 | #include <linux/pci.h> | 46 | #include <linux/pci.h> |
47 | #include <asm/pbm.h> | ||
48 | #endif | 47 | #endif |
49 | 48 | ||
50 | MODULE_AUTHOR("Thomas K. Dyas (tdyas@noc.rutgers.edu) and Eddie C. Dost (ecd@skynet.be)"); | 49 | MODULE_AUTHOR("Thomas K. Dyas (tdyas@noc.rutgers.edu) and Eddie C. Dost (ecd@skynet.be)"); |
@@ -141,7 +140,7 @@ static int copyout(void __user *info, struct openpromio *opp, int len) | |||
141 | 140 | ||
142 | static int opromgetprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize) | 141 | static int opromgetprop(void __user *argp, struct device_node *dp, struct openpromio *op, int bufsize) |
143 | { | 142 | { |
144 | void *pval; | 143 | const void *pval; |
145 | int len; | 144 | int len; |
146 | 145 | ||
147 | if (!dp || | 146 | if (!dp || |
@@ -248,18 +247,18 @@ static int oprompci2node(void __user *argp, struct device_node *dp, struct openp | |||
248 | if (bufsize >= 2*sizeof(int)) { | 247 | if (bufsize >= 2*sizeof(int)) { |
249 | #ifdef CONFIG_PCI | 248 | #ifdef CONFIG_PCI |
250 | struct pci_dev *pdev; | 249 | struct pci_dev *pdev; |
251 | struct pcidev_cookie *pcp; | 250 | struct device_node *dp; |
252 | pdev = pci_find_slot (((int *) op->oprom_array)[0], | 251 | |
252 | pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0], | ||
253 | ((int *) op->oprom_array)[1]); | 253 | ((int *) op->oprom_array)[1]); |
254 | 254 | ||
255 | pcp = pdev->sysdata; | 255 | dp = pci_device_to_OF_node(pdev); |
256 | if (pcp != NULL) { | 256 | data->current_node = dp; |
257 | dp = pcp->prom_node; | 257 | *((int *)op->oprom_array) = dp->node; |
258 | data->current_node = dp; | 258 | op->oprom_size = sizeof(int); |
259 | *((int *)op->oprom_array) = dp->node; | 259 | err = copyout(argp, op, bufsize + sizeof(int)); |
260 | op->oprom_size = sizeof(int); | 260 | |
261 | err = copyout(argp, op, bufsize + sizeof(int)); | 261 | pci_dev_put(pdev); |
262 | } | ||
263 | #endif | 262 | #endif |
264 | } | 263 | } |
265 | 264 | ||
@@ -409,7 +408,7 @@ static int opiocget(void __user *argp, DATA *data) | |||
409 | struct opiocdesc op; | 408 | struct opiocdesc op; |
410 | struct device_node *dp; | 409 | struct device_node *dp; |
411 | char *str; | 410 | char *str; |
412 | void *pval; | 411 | const void *pval; |
413 | int err, len; | 412 | int err, len; |
414 | 413 | ||
415 | if (copy_from_user(&op, argp, sizeof(op))) | 414 | if (copy_from_user(&op, argp, sizeof(op))) |
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 8bfb67ccdcd4..c3135e2fbd5a 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c | |||
@@ -259,11 +259,10 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, void __user *argp) | |||
259 | if (copy_from_user(&inout, argp, sizeof(inout))) | 259 | if (copy_from_user(&inout, argp, sizeof(inout))) |
260 | return -EFAULT; | 260 | return -EFAULT; |
261 | 261 | ||
262 | buffer = kmalloc(inout.len, GFP_KERNEL); | 262 | buffer = kzalloc(inout.len, GFP_KERNEL); |
263 | if (buffer == NULL) | 263 | if (buffer == NULL) |
264 | return -ENOMEM; | 264 | return -ENOMEM; |
265 | 265 | ||
266 | memset(buffer,0,inout.len); | ||
267 | vfc_lock_device(dev); | 266 | vfc_lock_device(dev); |
268 | inout.ret= | 267 | inout.ret= |
269 | vfc_i2c_recvbuf(dev,inout.addr & 0xff | 268 | vfc_i2c_recvbuf(dev,inout.addr & 0xff |