menelaus.c (e0c8a1f52d0d3dc5f79ce04d7bf6da0782dcee16) | menelaus.c (42a71ef97b7ac31ae8f929c36048fec5cd201a49) |
---|---|
1/* 2 * Copyright (C) 2004 Texas Instruments, Inc. 3 * 4 * Some parts based tps65010.c: 5 * Copyright (C) 2004 Texas Instruments and 6 * Copyright (C) 2004-2005 David Brownell 7 * 8 * Some parts based on tlv320aic24.c: --- 1169 unchanged lines hidden (view full) --- 1178/*-----------------------------------------------------------------------*/ 1179 1180static struct i2c_driver menelaus_i2c_driver; 1181 1182static int menelaus_probe(struct i2c_client *client, 1183 const struct i2c_device_id *id) 1184{ 1185 struct menelaus_chip *menelaus; | 1/* 2 * Copyright (C) 2004 Texas Instruments, Inc. 3 * 4 * Some parts based tps65010.c: 5 * Copyright (C) 2004 Texas Instruments and 6 * Copyright (C) 2004-2005 David Brownell 7 * 8 * Some parts based on tlv320aic24.c: --- 1169 unchanged lines hidden (view full) --- 1178/*-----------------------------------------------------------------------*/ 1179 1180static struct i2c_driver menelaus_i2c_driver; 1181 1182static int menelaus_probe(struct i2c_client *client, 1183 const struct i2c_device_id *id) 1184{ 1185 struct menelaus_chip *menelaus; |
1186 int rev = 0, val; | 1186 int rev = 0; |
1187 int err = 0; 1188 struct menelaus_platform_data *menelaus_pdata = 1189 dev_get_platdata(&client->dev); 1190 1191 if (the_menelaus) { 1192 dev_dbg(&client->dev, "only one %s for now\n", 1193 DRIVER_NAME); 1194 return -ENODEV; --- 36 unchanged lines hidden (view full) --- 1231 } 1232 } 1233 1234 mutex_init(&menelaus->lock); 1235 INIT_WORK(&menelaus->work, menelaus_work); 1236 1237 pr_info("Menelaus rev %d.%d\n", rev >> 4, rev & 0x0f); 1238 | 1187 int err = 0; 1188 struct menelaus_platform_data *menelaus_pdata = 1189 dev_get_platdata(&client->dev); 1190 1191 if (the_menelaus) { 1192 dev_dbg(&client->dev, "only one %s for now\n", 1193 DRIVER_NAME); 1194 return -ENODEV; --- 36 unchanged lines hidden (view full) --- 1231 } 1232 } 1233 1234 mutex_init(&menelaus->lock); 1235 INIT_WORK(&menelaus->work, menelaus_work); 1236 1237 pr_info("Menelaus rev %d.%d\n", rev >> 4, rev & 0x0f); 1238 |
1239 val = menelaus_read_reg(MENELAUS_VCORE_CTRL1); 1240 if (val < 0) | 1239 err = menelaus_read_reg(MENELAUS_VCORE_CTRL1); 1240 if (err < 0) |
1241 goto fail; | 1241 goto fail; |
1242 if (val & (1 << 7)) | 1242 if (err & BIT(7)) |
1243 menelaus->vcore_hw_mode = 1; 1244 else 1245 menelaus->vcore_hw_mode = 0; 1246 1247 if (menelaus_pdata != NULL && menelaus_pdata->late_init != NULL) { 1248 err = menelaus_pdata->late_init(&client->dev); 1249 if (err < 0) 1250 goto fail; --- 41 unchanged lines hidden --- | 1243 menelaus->vcore_hw_mode = 1; 1244 else 1245 menelaus->vcore_hw_mode = 0; 1246 1247 if (menelaus_pdata != NULL && menelaus_pdata->late_init != NULL) { 1248 err = menelaus_pdata->late_init(&client->dev); 1249 if (err < 0) 1250 goto fail; --- 41 unchanged lines hidden --- |