keywest: Get rid of useless i2c_device_name() macro
PATCH 1/1 keywest: Get rid of useless i2c_device_name() macro
The i2c_device_name() macro is used only once and doesn't have much value, it hurts redability more than it helps. Get rid of it.
Signed-off-by Jean Delvare <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
--- sound/ppc/keywest.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
sound/ppc/keywest.c +1 -5
@@ -33,10 +33,6 @@static struct pmac_keywest *keywest_ctx; -#ifndef i2c_device_name -#define i2c_device_name (x) ((x)->name) -#endif -static int keywest_probe (struct i2c_client *client,const struct i2c_device_id *id) {
@@ -56,7 +52,7 @@ static int keywest_attach_adapter(structif (! keywest_ctx)return -EINVAL ; -if (strncmp (i2c_device_name (adapter),"mac-io" ,6 )) +if (strncmp (adapter->name,"mac-io" ,6 ))return 0 ;/* ignored */ memset (&info,0 ,sizeof (struct i2c_board_info ));
Signature · 1 line
Jean Delvare
At Thu, 14 May 2009 14:37:21 +0200,
Quoted 6 lines · Jean Delvare
The
i2c_device_name()macro is used only once and doesn't have much value, it hurts redability more than it helps. Get rid of it.Signed-off-by Jean Delvare <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>
Applied now. Thanks.
Takashi
Quoted 31 lines
--- sound/ppc/keywest.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)sound/ppc/keywest.c +1
-5@@ -33,10 +33,6 @@static struct pmac_keywest *keywest_ctx; -#ifndef i2c_device_name -#define i2c_device_name (x) ((x)->name) -#endif -static int keywest_probe (struct i2c_client *client,const struct i2c_device_id *id) {@@ -56,7 +52,7 @@ static int keywest_attach_adapter(structif (! keywest_ctx)return -EINVAL ; -if (strncmp (i2c_device_name (adapter),"mac-io" ,6 )) +if (strncmp (adapter->name,"mac-io" ,6 ))return 0 ;/* ignored */ memset (&info,0 ,sizeof (struct i2c_board_info ));Signature · 2 lines
-- Jean Delvare