Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
torvalds committed Dec 16, 2011
2 parents 24545cf + b1f44e1 commit 64b3dcc
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 76 deletions.
6 changes: 2 additions & 4 deletions arch/sparc/kernel/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down
4 changes: 1 addition & 3 deletions arch/sparc/kernel/prom_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions arch/sparc/mm/btfixup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
27 changes: 5 additions & 22 deletions drivers/sbus/char/bbc_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand All @@ -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++;
Expand Down Expand Up @@ -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");
13 changes: 1 addition & 12 deletions drivers/sbus/char/display7seg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
12 changes: 1 addition & 11 deletions drivers/sbus/char/envctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
12 changes: 1 addition & 11 deletions drivers/sbus/char/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
12 changes: 1 addition & 11 deletions drivers/sbus/char/uctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

0 comments on commit 64b3dcc

Please sign in to comment.