Commit 93966243 authored by Nobuhiro Iwamatsu's avatar Nobuhiro Iwamatsu Committed by Alexandre Belloni

rtc: pcf8523: Remove struct pcf8523

struct pcf8523 is referenced only by pcf8523_probe(). And member variable in
this is not referenced by any function. Remove struct pcf8523.
Signed-off-by: default avatarNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Link: https://lore.kernel.org/r/20191123090838.1619-1-nobuhiro1.iwamatsu@toshiba.co.jpSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 60bd22fc
...@@ -35,10 +35,6 @@ ...@@ -35,10 +35,6 @@
#define REG_OFFSET 0x0e #define REG_OFFSET 0x0e
#define REG_OFFSET_MODE BIT(7) #define REG_OFFSET_MODE BIT(7)
struct pcf8523 {
struct rtc_device *rtc;
};
static int pcf8523_read(struct i2c_client *client, u8 reg, u8 *valuep) static int pcf8523_read(struct i2c_client *client, u8 reg, u8 *valuep)
{ {
struct i2c_msg msgs[2]; struct i2c_msg msgs[2];
...@@ -345,16 +341,12 @@ static const struct rtc_class_ops pcf8523_rtc_ops = { ...@@ -345,16 +341,12 @@ static const struct rtc_class_ops pcf8523_rtc_ops = {
static int pcf8523_probe(struct i2c_client *client, static int pcf8523_probe(struct i2c_client *client,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
struct pcf8523 *pcf; struct rtc_device *rtc;
int err; int err;
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
return -ENODEV; return -ENODEV;
pcf = devm_kzalloc(&client->dev, sizeof(*pcf), GFP_KERNEL);
if (!pcf)
return -ENOMEM;
err = pcf8523_load_capacitance(client); err = pcf8523_load_capacitance(client);
if (err < 0) if (err < 0)
dev_warn(&client->dev, "failed to set xtal load capacitance: %d", dev_warn(&client->dev, "failed to set xtal load capacitance: %d",
...@@ -364,12 +356,10 @@ static int pcf8523_probe(struct i2c_client *client, ...@@ -364,12 +356,10 @@ static int pcf8523_probe(struct i2c_client *client,
if (err < 0) if (err < 0)
return err; return err;
pcf->rtc = devm_rtc_device_register(&client->dev, DRIVER_NAME, rtc = devm_rtc_device_register(&client->dev, DRIVER_NAME,
&pcf8523_rtc_ops, THIS_MODULE); &pcf8523_rtc_ops, THIS_MODULE);
if (IS_ERR(pcf->rtc)) if (IS_ERR(rtc))
return PTR_ERR(pcf->rtc); return PTR_ERR(rtc);
i2c_set_clientdata(client, pcf);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment