Commit 64b3dcc3 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc32: Be less strict in matching %lo part of relocation.
  sbus: convert drivers/sbus/char/* to use module_platform_driver()
  bbc_i2c: Remove unneeded err variable
  sparc: Use kmemdup rather than duplicating its implementation
parents 24545cf1 b1f44e13
...@@ -1181,13 +1181,11 @@ static int __devinit ds_probe(struct vio_dev *vdev, ...@@ -1181,13 +1181,11 @@ static int __devinit ds_probe(struct vio_dev *vdev,
dp->rcv_buf_len = 4096; dp->rcv_buf_len = 4096;
dp->ds_states = kzalloc(sizeof(ds_states_template), dp->ds_states = kmemdup(ds_states_template,
GFP_KERNEL); sizeof(ds_states_template), GFP_KERNEL);
if (!dp->ds_states) if (!dp->ds_states)
goto out_free_rcv_buf; goto out_free_rcv_buf;
memcpy(dp->ds_states, ds_states_template,
sizeof(ds_states_template));
dp->num_ds_states = ARRAY_SIZE(ds_states_template); dp->num_ds_states = ARRAY_SIZE(ds_states_template);
for (i = 0; i < dp->num_ds_states; i++) for (i = 0; i < dp->num_ds_states; i++)
......
...@@ -58,12 +58,10 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len ...@@ -58,12 +58,10 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
void *new_val; void *new_val;
int err; int err;
new_val = kmalloc(len, GFP_KERNEL); new_val = kmemdup(val, len, GFP_KERNEL);
if (!new_val) if (!new_val)
return -ENOMEM; return -ENOMEM;
memcpy(new_val, val, len);
err = -ENODEV; err = -ENODEV;
mutex_lock(&of_set_property_mutex); mutex_lock(&of_set_property_mutex);
......
...@@ -302,8 +302,7 @@ void __init btfixup(void) ...@@ -302,8 +302,7 @@ void __init btfixup(void)
case 'i': /* INT */ case 'i': /* INT */
if ((insn & 0xc1c00000) == 0x01000000) /* %HI */ if ((insn & 0xc1c00000) == 0x01000000) /* %HI */
set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10)); set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10));
else if ((insn & 0x80002000) == 0x80002000 && else if ((insn & 0x80002000) == 0x80002000) /* %LO */
(insn & 0x01800000) != 0x01800000) /* %LO */
set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff)); set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff));
else { else {
prom_printf(insn_i, p, addr, insn); prom_printf(insn_i, p, addr, insn);
......
...@@ -233,13 +233,9 @@ int bbc_i2c_write_buf(struct bbc_i2c_client *client, ...@@ -233,13 +233,9 @@ int bbc_i2c_write_buf(struct bbc_i2c_client *client,
int ret = 0; int ret = 0;
while (len > 0) { while (len > 0) {
int err = bbc_i2c_writeb(client, *buf, off); ret = bbc_i2c_writeb(client, *buf, off);
if (ret < 0)
if (err < 0) {
ret = err;
break; break;
}
len--; len--;
buf++; buf++;
off++; off++;
...@@ -253,11 +249,9 @@ int bbc_i2c_read_buf(struct bbc_i2c_client *client, ...@@ -253,11 +249,9 @@ int bbc_i2c_read_buf(struct bbc_i2c_client *client,
int ret = 0; int ret = 0;
while (len > 0) { while (len > 0) {
int err = bbc_i2c_readb(client, buf, off); ret = bbc_i2c_readb(client, buf, off);
if (err < 0) { if (ret < 0)
ret = err;
break; break;
}
len--; len--;
buf++; buf++;
off++; off++;
...@@ -422,17 +416,6 @@ static struct platform_driver bbc_i2c_driver = { ...@@ -422,17 +416,6 @@ static struct platform_driver bbc_i2c_driver = {
.remove = __devexit_p(bbc_i2c_remove), .remove = __devexit_p(bbc_i2c_remove),
}; };
static int __init bbc_i2c_init(void) module_platform_driver(bbc_i2c_driver);
{
return platform_driver_register(&bbc_i2c_driver);
}
static void __exit bbc_i2c_exit(void)
{
platform_driver_unregister(&bbc_i2c_driver);
}
module_init(bbc_i2c_init);
module_exit(bbc_i2c_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -275,15 +275,4 @@ static struct platform_driver d7s_driver = { ...@@ -275,15 +275,4 @@ static struct platform_driver d7s_driver = {
.remove = __devexit_p(d7s_remove), .remove = __devexit_p(d7s_remove),
}; };
static int __init d7s_init(void) module_platform_driver(d7s_driver);
{
return platform_driver_register(&d7s_driver);
}
static void __exit d7s_exit(void)
{
platform_driver_unregister(&d7s_driver);
}
module_init(d7s_init);
module_exit(d7s_exit);
...@@ -1138,16 +1138,6 @@ static struct platform_driver envctrl_driver = { ...@@ -1138,16 +1138,6 @@ static struct platform_driver envctrl_driver = {
.remove = __devexit_p(envctrl_remove), .remove = __devexit_p(envctrl_remove),
}; };
static int __init envctrl_init(void) module_platform_driver(envctrl_driver);
{
return platform_driver_register(&envctrl_driver);
}
static void __exit envctrl_exit(void)
{
platform_driver_unregister(&envctrl_driver);
}
module_init(envctrl_init);
module_exit(envctrl_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -216,16 +216,6 @@ static struct platform_driver flash_driver = { ...@@ -216,16 +216,6 @@ static struct platform_driver flash_driver = {
.remove = __devexit_p(flash_remove), .remove = __devexit_p(flash_remove),
}; };
static int __init flash_init(void) module_platform_driver(flash_driver);
{
return platform_driver_register(&flash_driver);
}
static void __exit flash_cleanup(void)
{
platform_driver_unregister(&flash_driver);
}
module_init(flash_init);
module_exit(flash_cleanup);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -435,16 +435,6 @@ static struct platform_driver uctrl_driver = { ...@@ -435,16 +435,6 @@ static struct platform_driver uctrl_driver = {
}; };
static int __init uctrl_init(void) module_platform_driver(uctrl_driver);
{
return platform_driver_register(&uctrl_driver);
}
static void __exit uctrl_exit(void)
{
platform_driver_unregister(&uctrl_driver);
}
module_init(uctrl_init);
module_exit(uctrl_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment