Skip to content

Commit 9396624

Browse files
iwamatsualexandrebelloni
authored andcommitted
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: Nobuhiro Iwamatsu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 60bd22f commit 9396624

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

drivers/rtc/rtc-pcf8523.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
#define REG_OFFSET 0x0e
3636
#define REG_OFFSET_MODE BIT(7)
3737

38-
struct pcf8523 {
39-
struct rtc_device *rtc;
40-
};
41-
4238
static int pcf8523_read(struct i2c_client *client, u8 reg, u8 *valuep)
4339
{
4440
struct i2c_msg msgs[2];
@@ -345,16 +341,12 @@ static const struct rtc_class_ops pcf8523_rtc_ops = {
345341
static int pcf8523_probe(struct i2c_client *client,
346342
const struct i2c_device_id *id)
347343
{
348-
struct pcf8523 *pcf;
344+
struct rtc_device *rtc;
349345
int err;
350346

351347
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
352348
return -ENODEV;
353349

354-
pcf = devm_kzalloc(&client->dev, sizeof(*pcf), GFP_KERNEL);
355-
if (!pcf)
356-
return -ENOMEM;
357-
358350
err = pcf8523_load_capacitance(client);
359351
if (err < 0)
360352
dev_warn(&client->dev, "failed to set xtal load capacitance: %d",
@@ -364,12 +356,10 @@ static int pcf8523_probe(struct i2c_client *client,
364356
if (err < 0)
365357
return err;
366358

367-
pcf->rtc = devm_rtc_device_register(&client->dev, DRIVER_NAME,
359+
rtc = devm_rtc_device_register(&client->dev, DRIVER_NAME,
368360
&pcf8523_rtc_ops, THIS_MODULE);
369-
if (IS_ERR(pcf->rtc))
370-
return PTR_ERR(pcf->rtc);
371-
372-
i2c_set_clientdata(client, pcf);
361+
if (IS_ERR(rtc))
362+
return PTR_ERR(rtc);
373363

374364
return 0;
375365
}

0 commit comments

Comments
 (0)