diff options
Diffstat (limited to 'drivers/rtc/rtc-x1205.c')
-rw-r--r-- | drivers/rtc/rtc-x1205.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c index 522c69753bbf..019ae255b0c8 100644 --- a/drivers/rtc/rtc-x1205.c +++ b/drivers/rtc/rtc-x1205.c | |||
@@ -372,7 +372,7 @@ static int x1205_validate_client(struct i2c_client *client) | |||
372 | }; | 372 | }; |
373 | 373 | ||
374 | if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) { | 374 | if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) { |
375 | dev_err(&client->adapter->dev, | 375 | dev_err(&client->dev, |
376 | "%s: could not read register %x\n", | 376 | "%s: could not read register %x\n", |
377 | __FUNCTION__, probe_zero_pattern[i]); | 377 | __FUNCTION__, probe_zero_pattern[i]); |
378 | 378 | ||
@@ -380,7 +380,7 @@ static int x1205_validate_client(struct i2c_client *client) | |||
380 | } | 380 | } |
381 | 381 | ||
382 | if ((buf & probe_zero_pattern[i+1]) != 0) { | 382 | if ((buf & probe_zero_pattern[i+1]) != 0) { |
383 | dev_err(&client->adapter->dev, | 383 | dev_err(&client->dev, |
384 | "%s: register=%02x, zero pattern=%d, value=%x\n", | 384 | "%s: register=%02x, zero pattern=%d, value=%x\n", |
385 | __FUNCTION__, probe_zero_pattern[i], i, buf); | 385 | __FUNCTION__, probe_zero_pattern[i], i, buf); |
386 | 386 | ||
@@ -400,7 +400,7 @@ static int x1205_validate_client(struct i2c_client *client) | |||
400 | }; | 400 | }; |
401 | 401 | ||
402 | if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) { | 402 | if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) { |
403 | dev_err(&client->adapter->dev, | 403 | dev_err(&client->dev, |
404 | "%s: could not read register %x\n", | 404 | "%s: could not read register %x\n", |
405 | __FUNCTION__, probe_limits_pattern[i].reg); | 405 | __FUNCTION__, probe_limits_pattern[i].reg); |
406 | 406 | ||
@@ -411,7 +411,7 @@ static int x1205_validate_client(struct i2c_client *client) | |||
411 | 411 | ||
412 | if (value > probe_limits_pattern[i].max || | 412 | if (value > probe_limits_pattern[i].max || |
413 | value < probe_limits_pattern[i].min) { | 413 | value < probe_limits_pattern[i].min) { |
414 | dev_dbg(&client->adapter->dev, | 414 | dev_dbg(&client->dev, |
415 | "%s: register=%x, lim pattern=%d, value=%d\n", | 415 | "%s: register=%x, lim pattern=%d, value=%d\n", |
416 | __FUNCTION__, probe_limits_pattern[i].reg, | 416 | __FUNCTION__, probe_limits_pattern[i].reg, |
417 | i, value); | 417 | i, value); |
@@ -506,7 +506,7 @@ static int x1205_probe(struct i2c_adapter *adapter, int address, int kind) | |||
506 | struct i2c_client *client; | 506 | struct i2c_client *client; |
507 | struct rtc_device *rtc; | 507 | struct rtc_device *rtc; |
508 | 508 | ||
509 | dev_dbg(&adapter->dev, "%s\n", __FUNCTION__); | 509 | dev_dbg(adapter->class_dev.dev, "%s\n", __FUNCTION__); |
510 | 510 | ||
511 | if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { | 511 | if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { |
512 | err = -ENODEV; | 512 | err = -ENODEV; |
@@ -562,11 +562,19 @@ static int x1205_probe(struct i2c_adapter *adapter, int address, int kind) | |||
562 | else | 562 | else |
563 | dev_err(&client->dev, "couldn't read status\n"); | 563 | dev_err(&client->dev, "couldn't read status\n"); |
564 | 564 | ||
565 | device_create_file(&client->dev, &dev_attr_atrim); | 565 | err = device_create_file(&client->dev, &dev_attr_atrim); |
566 | device_create_file(&client->dev, &dev_attr_dtrim); | 566 | if (err) goto exit_devreg; |
567 | err = device_create_file(&client->dev, &dev_attr_dtrim); | ||
568 | if (err) goto exit_atrim; | ||
567 | 569 | ||
568 | return 0; | 570 | return 0; |
569 | 571 | ||
572 | exit_atrim: | ||
573 | device_remove_file(&client->dev, &dev_attr_atrim); | ||
574 | |||
575 | exit_devreg: | ||
576 | rtc_device_unregister(rtc); | ||
577 | |||
570 | exit_detach: | 578 | exit_detach: |
571 | i2c_detach_client(client); | 579 | i2c_detach_client(client); |
572 | 580 | ||