@@ -496,14 +496,13 @@ void power_supply_put(struct power_supply *psy)
496
496
}
497
497
EXPORT_SYMBOL_GPL (power_supply_put );
498
498
499
- #ifdef CONFIG_OF
500
499
static int power_supply_match_device_fwnode (struct device * dev , const void * data )
501
500
{
502
501
return dev -> parent && dev_fwnode (dev -> parent ) == data ;
503
502
}
504
503
505
504
/**
506
- * power_supply_get_by_phandle () - Search for a power supply and returns its ref
505
+ * power_supply_get_by_reference () - Search for a power supply and returns its ref
507
506
* @fwnode: Pointer to fwnode holding phandle property
508
507
* @property: Name of property holding a power supply name
509
508
*
@@ -514,8 +513,8 @@ static int power_supply_match_device_fwnode(struct device *dev, const void *data
514
513
* Return: On success returns a reference to a power supply with
515
514
* matching name equals to value under @property, NULL or ERR_PTR otherwise.
516
515
*/
517
- struct power_supply * power_supply_get_by_phandle (struct fwnode_handle * fwnode ,
518
- const char * property )
516
+ struct power_supply * power_supply_get_by_reference (struct fwnode_handle * fwnode ,
517
+ const char * property )
519
518
{
520
519
struct fwnode_handle * power_supply_fwnode ;
521
520
struct power_supply * psy = NULL ;
@@ -537,7 +536,7 @@ struct power_supply *power_supply_get_by_phandle(struct fwnode_handle *fwnode,
537
536
538
537
return psy ;
539
538
}
540
- EXPORT_SYMBOL_GPL (power_supply_get_by_phandle );
539
+ EXPORT_SYMBOL_GPL (power_supply_get_by_reference );
541
540
542
541
static void devm_power_supply_put (struct device * dev , void * res )
543
542
{
@@ -547,16 +546,16 @@ static void devm_power_supply_put(struct device *dev, void *res)
547
546
}
548
547
549
548
/**
550
- * devm_power_supply_get_by_phandle () - Resource managed version of
551
- * power_supply_get_by_phandle ()
549
+ * devm_power_supply_get_by_reference () - Resource managed version of
550
+ * power_supply_get_by_reference ()
552
551
* @dev: Pointer to device holding phandle property
553
552
* @property: Name of property holding a power supply phandle
554
553
*
555
554
* Return: On success returns a reference to a power supply with
556
555
* matching name equals to value under @property, NULL or ERR_PTR otherwise.
557
556
*/
558
- struct power_supply * devm_power_supply_get_by_phandle (struct device * dev ,
559
- const char * property )
557
+ struct power_supply * devm_power_supply_get_by_reference (struct device * dev ,
558
+ const char * property )
560
559
{
561
560
struct power_supply * * ptr , * psy ;
562
561
@@ -567,7 +566,7 @@ struct power_supply *devm_power_supply_get_by_phandle(struct device *dev,
567
566
if (!ptr )
568
567
return ERR_PTR (- ENOMEM );
569
568
570
- psy = power_supply_get_by_phandle (dev_fwnode (dev ), property );
569
+ psy = power_supply_get_by_reference (dev_fwnode (dev ), property );
571
570
if (IS_ERR_OR_NULL (psy )) {
572
571
devres_free (ptr );
573
572
} else {
@@ -576,8 +575,7 @@ struct power_supply *devm_power_supply_get_by_phandle(struct device *dev,
576
575
}
577
576
return psy ;
578
577
}
579
- EXPORT_SYMBOL_GPL (devm_power_supply_get_by_phandle );
580
- #endif /* CONFIG_OF */
578
+ EXPORT_SYMBOL_GPL (devm_power_supply_get_by_reference );
581
579
582
580
int power_supply_get_battery_info (struct power_supply * psy ,
583
581
struct power_supply_battery_info * * info_out )
0 commit comments