Further cleanup
This commit is contained in:
parent
8d73f4e647
commit
34ee966cba
@ -14,30 +14,29 @@ Signed-off-by: Abhishek Paliwal <abhishek.paliwal@aricent.com>
|
||||
--- a/drivers/misc/eeprom/at24.c
|
||||
+++ b/drivers/misc/eeprom/at24.c
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <linux/of.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/platform_data/at24.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
+#include <linux/of_memory_accessor.h>
|
||||
|
||||
/*
|
||||
* I2C EEPROMs from most vendors are inexpensive and mostly interchangeable.
|
||||
@@ -637,6 +638,9 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
||||
if (chip.setup)
|
||||
chip.setup(&at24->macc, chip.context);
|
||||
/* Address pointer is 16 bit. */
|
||||
#define AT24_FLAG_ADDR16 BIT(7)
|
||||
@@ -720,6 +721,9 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
||||
byte_len, client->name,
|
||||
writable ? "writable" : "read-only", at24->write_max);
|
||||
|
||||
+ if (client->dev.of_node)
|
||||
+ of_memory_accessor_register(&client->dev, &at24->macc);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
err_clients:
|
||||
@@ -655,6 +659,9 @@ static int at24_remove(struct i2c_client *client)
|
||||
at24 = i2c_get_clientdata(client);
|
||||
sysfs_remove_bin_file(&client->dev.kobj, &at24->bin);
|
||||
@@ -728,5 +732,8 @@ static int at24_remove(struct i2c_client *client)
|
||||
pm_runtime_disable(&client->dev);
|
||||
pm_runtime_set_suspended(&client->dev);
|
||||
|
||||
+ if (client->dev.of_node)
|
||||
+ of_memory_accessor_remove(&client->dev);
|
||||
+
|
||||
for (i = 1; i < at24->num_addresses; i++)
|
||||
i2c_unregister_device(at24->client[i]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user