aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/ppc/keywest.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/ppc/keywest.c')
-rw-r--r--sound/ppc/keywest.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/sound/ppc/keywest.c b/sound/ppc/keywest.c
index 9554a0c506af..dfc1fc9b701d 100644
--- a/sound/ppc/keywest.c
+++ b/sound/ppc/keywest.c
@@ -13,16 +13,10 @@
#include <sound/core.h>
#include "pmac.h"
-/*
- * we have to keep a static variable here since i2c attach_adapter
- * callback cannot pass a private data.
- */
static struct pmac_keywest *keywest_ctx;
-
static bool keywest_probed;
-static int keywest_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int keywest_probe(struct i2c_client *client)
{
keywest_probed = true;
/* If instantiated via i2c-powermac, we still need to set the client */
@@ -49,7 +43,7 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
return -EINVAL; /* ignored */
memset(&info, 0, sizeof(struct i2c_board_info));
- strlcpy(info.type, "keywest", I2C_NAME_SIZE);
+ strscpy(info.type, "keywest", I2C_NAME_SIZE);
info.addr = keywest_ctx->addr;
client = i2c_new_client_device(adapter, &info);
if (IS_ERR(client))
@@ -76,14 +70,12 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
return 0;
}
-static int keywest_remove(struct i2c_client *client)
+static void keywest_remove(struct i2c_client *client)
{
if (! keywest_ctx)
- return 0;
+ return;
if (client == keywest_ctx->client)
keywest_ctx->client = NULL;
-
- return 0;
}
@@ -119,7 +111,8 @@ int snd_pmac_tumbler_post_init(void)
if (!keywest_ctx || !keywest_ctx->client)
return -ENXIO;
- if ((err = keywest_ctx->init_client(keywest_ctx)) < 0) {
+ err = keywest_ctx->init_client(keywest_ctx);
+ if (err < 0) {
snd_printk(KERN_ERR "tumbler: %i :cannot initialize the MCS\n", err);
return err;
}
@@ -141,7 +134,8 @@ int snd_pmac_keywest_init(struct pmac_keywest *i2c)
keywest_ctx = i2c;
- if ((err = i2c_add_driver(&keywest_driver))) {
+ err = i2c_add_driver(&keywest_driver);
+ if (err) {
snd_printk(KERN_ERR "cannot register keywest i2c driver\n");
i2c_put_adapter(adap);
return err;