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,
dp->rcv_buf_len = 4096;
dp->ds_states = kzalloc(sizeof(ds_states_template),
GFP_KERNEL);
dp->ds_states = kmemdup(ds_states_template,
sizeof(ds_states_template), GFP_KERNEL);
if (!dp->ds_states)
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);
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
void *new_val;
int err;
new_val = kmalloc(len, GFP_KERNEL);
new_val = kmemdup(val, len, GFP_KERNEL);
if (!new_val)
return -ENOMEM;
memcpy(new_val, val, len);
err = -ENODEV;
mutex_lock(&of_set_property_mutex);
......
......@@ -302,8 +302,7 @@ void __init btfixup(void)
case 'i': /* INT */
if ((insn & 0xc1c00000) == 0x01000000) /* %HI */
set_addr(addr, q[1], fmangled, (insn & 0xffc00000) | (p[1] >> 10));
else if ((insn & 0x80002000) == 0x80002000 &&
(insn & 0x01800000) != 0x01800000) /* %LO */
else if ((insn & 0x80002000) == 0x80002000) /* %LO */
set_addr(addr, q[1], fmangled, (insn & 0xffffe000) | (p[1] & 0x3ff));
else {
prom_printf(insn_i, p, addr, insn);
......
......@@ -233,13 +233,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 +249,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++;
......@@ -422,17 +416,6 @@ static struct platform_driver bbc_i2c_driver = {
.remove = __devexit_p(bbc_i2c_remove),
};
static int __init bbc_i2c_init(void)
{
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_platform_driver(bbc_i2c_driver);
MODULE_LICENSE("GPL");
......@@ -275,15 +275,4 @@ static struct platform_driver d7s_driver = {
.remove = __devexit_p(d7s_remove),
};
static int __init d7s_init(void)
{
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);
module_platform_driver(d7s_driver);
......@@ -1138,16 +1138,6 @@ static struct platform_driver envctrl_driver = {
.remove = __devexit_p(envctrl_remove),
};
static int __init envctrl_init(void)
{
return platform_driver_register(&envctrl_driver);
}
static void __exit envctrl_exit(void)
{
platform_driver_unregister(&envctrl_driver);
}
module_platform_driver(envctrl_driver);
module_init(envctrl_init);
module_exit(envctrl_exit);
MODULE_LICENSE("GPL");
......@@ -216,16 +216,6 @@ static struct platform_driver flash_driver = {
.remove = __devexit_p(flash_remove),
};
static int __init flash_init(void)
{
return platform_driver_register(&flash_driver);
}
static void __exit flash_cleanup(void)
{
platform_driver_unregister(&flash_driver);
}
module_platform_driver(flash_driver);
module_init(flash_init);
module_exit(flash_cleanup);
MODULE_LICENSE("GPL");
......@@ -435,16 +435,6 @@ static struct platform_driver uctrl_driver = {
};
static int __init uctrl_init(void)
{
return platform_driver_register(&uctrl_driver);
}
static void __exit uctrl_exit(void)
{
platform_driver_unregister(&uctrl_driver);
}
module_platform_driver(uctrl_driver);
module_init(uctrl_init);
module_exit(uctrl_exit);
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