Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299106
b: refs/heads/master
c: 40f32d9
h: refs/heads/master
v: v3
  • Loading branch information
Preetham Chandru authored and Greg Kroah-Hartman committed Apr 10, 2012
1 parent 84ad7de commit 12e7af0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be0775ac140dd80a1d60fb7e71ec60e649c14ff8
refs/heads/master: 40f32d9345bee0b24d3317b498e79b02e4be27f4
8 changes: 5 additions & 3 deletions trunk/drivers/staging/iio/magnetometer/ak8975.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ static const int ak8975_index_to_reg[] = {
static int ak8975_write_data(struct i2c_client *client,
u8 reg, u8 val, u8 mask, u8 shift)
{
struct ak8975_data *data = i2c_get_clientdata(client);
struct iio_dev *indio_dev = i2c_get_clientdata(client);
struct ak8975_data *data = iio_priv(indio_dev);
u8 regval;
int ret;

Expand Down Expand Up @@ -159,7 +160,8 @@ static int ak8975_read_data(struct i2c_client *client,
*/
static int ak8975_setup(struct i2c_client *client)
{
struct ak8975_data *data = i2c_get_clientdata(client);
struct iio_dev *indio_dev = i2c_get_clientdata(client);
struct ak8975_data *data = iio_priv(indio_dev);
u8 device_id;
int ret;

Expand Down Expand Up @@ -509,14 +511,14 @@ static int ak8975_probe(struct i2c_client *client,
goto exit_gpio;
}
data = iio_priv(indio_dev);
i2c_set_clientdata(client, indio_dev);
/* Perform some basic start-of-day setup of the device. */
err = ak8975_setup(client);
if (err < 0) {
dev_err(&client->dev, "AK8975 initialization fails\n");
goto exit_free_iio;
}

i2c_set_clientdata(client, indio_dev);
data->client = client;
mutex_init(&data->lock);
data->eoc_irq = client->irq;
Expand Down

0 comments on commit 12e7af0

Please sign in to comment.