@@ -313,16 +313,16 @@ static void db8500_thermal_work(struct work_struct *work)
313
313
}
314
314
315
315
static struct db8500_thsens_platform_data *
316
- db8500_thermal_parse_dt (struct platform_device * pdev )
316
+ db8500_thermal_parse_dt (struct device * dev )
317
317
{
318
318
struct db8500_thsens_platform_data * ptrips ;
319
- struct device_node * np = pdev -> dev . of_node ;
319
+ struct device_node * np = dev -> of_node ;
320
320
char prop_name [32 ];
321
321
const char * tmp_str ;
322
322
u32 tmp_data ;
323
323
int i , j ;
324
324
325
- ptrips = devm_kzalloc (& pdev -> dev , sizeof (* ptrips ), GFP_KERNEL );
325
+ ptrips = devm_kzalloc (dev , sizeof (* ptrips ), GFP_KERNEL );
326
326
if (!ptrips )
327
327
return NULL ;
328
328
@@ -377,26 +377,27 @@ static struct db8500_thsens_platform_data*
377
377
return ptrips ;
378
378
379
379
err_parse_dt :
380
- dev_err (& pdev -> dev , "Parsing device tree data error.\n" );
380
+ dev_err (dev , "Parsing device tree data error.\n" );
381
381
return NULL ;
382
382
}
383
383
384
384
static int db8500_thermal_probe (struct platform_device * pdev )
385
385
{
386
386
struct db8500_thermal_zone * pzone = NULL ;
387
387
struct db8500_thsens_platform_data * ptrips = NULL ;
388
- struct device_node * np = pdev -> dev .of_node ;
388
+ struct device * dev = & pdev -> dev ;
389
+ struct device_node * np = dev -> of_node ;
389
390
int low_irq , high_irq , ret = 0 ;
390
391
unsigned long dft_low , dft_high ;
391
392
392
393
if (!np )
393
394
return - EINVAL ;
394
395
395
- ptrips = db8500_thermal_parse_dt (pdev );
396
+ ptrips = db8500_thermal_parse_dt (dev );
396
397
if (!ptrips )
397
398
return - EINVAL ;
398
399
399
- pzone = devm_kzalloc (& pdev -> dev , sizeof (* pzone ), GFP_KERNEL );
400
+ pzone = devm_kzalloc (dev , sizeof (* pzone ), GFP_KERNEL );
400
401
if (!pzone )
401
402
return - ENOMEM ;
402
403
@@ -410,43 +411,43 @@ static int db8500_thermal_probe(struct platform_device *pdev)
410
411
411
412
low_irq = platform_get_irq_byname (pdev , "IRQ_HOTMON_LOW" );
412
413
if (low_irq < 0 ) {
413
- dev_err (& pdev -> dev , "Get IRQ_HOTMON_LOW failed.\n" );
414
+ dev_err (dev , "Get IRQ_HOTMON_LOW failed.\n" );
414
415
ret = low_irq ;
415
416
goto out_unlock ;
416
417
}
417
418
418
- ret = devm_request_threaded_irq (& pdev -> dev , low_irq , NULL ,
419
+ ret = devm_request_threaded_irq (dev , low_irq , NULL ,
419
420
prcmu_low_irq_handler , IRQF_NO_SUSPEND | IRQF_ONESHOT ,
420
421
"dbx500_temp_low" , pzone );
421
422
if (ret < 0 ) {
422
- dev_err (& pdev -> dev , "Failed to allocate temp low irq.\n" );
423
+ dev_err (dev , "Failed to allocate temp low irq.\n" );
423
424
goto out_unlock ;
424
425
}
425
426
426
427
high_irq = platform_get_irq_byname (pdev , "IRQ_HOTMON_HIGH" );
427
428
if (high_irq < 0 ) {
428
- dev_err (& pdev -> dev , "Get IRQ_HOTMON_HIGH failed.\n" );
429
+ dev_err (dev , "Get IRQ_HOTMON_HIGH failed.\n" );
429
430
ret = high_irq ;
430
431
goto out_unlock ;
431
432
}
432
433
433
- ret = devm_request_threaded_irq (& pdev -> dev , high_irq , NULL ,
434
+ ret = devm_request_threaded_irq (dev , high_irq , NULL ,
434
435
prcmu_high_irq_handler , IRQF_NO_SUSPEND | IRQF_ONESHOT ,
435
436
"dbx500_temp_high" , pzone );
436
437
if (ret < 0 ) {
437
- dev_err (& pdev -> dev , "Failed to allocate temp high irq.\n" );
438
+ dev_err (dev , "Failed to allocate temp high irq.\n" );
438
439
goto out_unlock ;
439
440
}
440
441
441
442
pzone -> therm_dev = thermal_zone_device_register ("db8500_thermal_zone" ,
442
443
ptrips -> num_trips , 0 , pzone , & thdev_ops , NULL , 0 , 0 );
443
444
444
445
if (IS_ERR (pzone -> therm_dev )) {
445
- dev_err (& pdev -> dev , "Register thermal zone device failed.\n" );
446
+ dev_err (dev , "Register thermal zone device failed.\n" );
446
447
ret = PTR_ERR (pzone -> therm_dev );
447
448
goto out_unlock ;
448
449
}
449
- dev_info (& pdev -> dev , "Thermal zone device registered.\n" );
450
+ dev_info (dev , "Thermal zone device registered.\n" );
450
451
451
452
dft_low = PRCMU_DEFAULT_LOW_TEMP ;
452
453
dft_high = ptrips -> trip_points [0 ].temp ;
0 commit comments