File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change 35
35
#define REG_OFFSET 0x0e
36
36
#define REG_OFFSET_MODE BIT(7)
37
37
38
- struct pcf8523 {
39
- struct rtc_device * rtc ;
40
- };
41
-
42
38
static int pcf8523_read (struct i2c_client * client , u8 reg , u8 * valuep )
43
39
{
44
40
struct i2c_msg msgs [2 ];
@@ -345,16 +341,12 @@ static const struct rtc_class_ops pcf8523_rtc_ops = {
345
341
static int pcf8523_probe (struct i2c_client * client ,
346
342
const struct i2c_device_id * id )
347
343
{
348
- struct pcf8523 * pcf ;
344
+ struct rtc_device * rtc ;
349
345
int err ;
350
346
351
347
if (!i2c_check_functionality (client -> adapter , I2C_FUNC_I2C ))
352
348
return - ENODEV ;
353
349
354
- pcf = devm_kzalloc (& client -> dev , sizeof (* pcf ), GFP_KERNEL );
355
- if (!pcf )
356
- return - ENOMEM ;
357
-
358
350
err = pcf8523_load_capacitance (client );
359
351
if (err < 0 )
360
352
dev_warn (& client -> dev , "failed to set xtal load capacitance: %d" ,
@@ -364,12 +356,10 @@ static int pcf8523_probe(struct i2c_client *client,
364
356
if (err < 0 )
365
357
return err ;
366
358
367
- pcf -> rtc = devm_rtc_device_register (& client -> dev , DRIVER_NAME ,
359
+ rtc = devm_rtc_device_register (& client -> dev , DRIVER_NAME ,
368
360
& 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 );
373
363
374
364
return 0 ;
375
365
}
You can’t perform that action at this time.
0 commit comments