linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers\power\supply: use kobj_to_dev
@ 2020-06-12  6:55 Wang Qing
  2020-06-19 14:57 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Qing @ 2020-06-12  6:55 UTC (permalink / raw)
  To: Sebastian Reichel, linux-pm, linux-kernel; +Cc: Wang Qing

Use kobj_to_dev() API instead of container_of().

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/power/supply/power_supply_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 drivers/power/supply/power_supply_sysfs.c

diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index bc79560..af0cad2
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -343,7 +343,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj,
 					   struct attribute *attr,
 					   int attrno)
 {
-	struct device *dev = container_of(kobj, struct device, kobj);
+	struct device *dev = kobj_to_dev(kobj);
 	struct power_supply *psy = dev_get_drvdata(dev);
 	umode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
 	int i;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers\power\supply: use kobj_to_dev
  2020-06-12  6:55 [PATCH] drivers\power\supply: use kobj_to_dev Wang Qing
@ 2020-06-19 14:57 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2020-06-19 14:57 UTC (permalink / raw)
  To: Wang Qing; +Cc: linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]

Hi,

On Fri, Jun 12, 2020 at 02:55:54PM +0800, Wang Qing wrote:
> Use kobj_to_dev() API instead of container_of().
> 
> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/power_supply_sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>  mode change 100644 => 100755 drivers/power/supply/power_supply_sysfs.c
> 
> diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
> index bc79560..af0cad2
> --- a/drivers/power/supply/power_supply_sysfs.c
> +++ b/drivers/power/supply/power_supply_sysfs.c
> @@ -343,7 +343,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj,
>  					   struct attribute *attr,
>  					   int attrno)
>  {
> -	struct device *dev = container_of(kobj, struct device, kobj);
> +	struct device *dev = kobj_to_dev(kobj);
>  	struct power_supply *psy = dev_get_drvdata(dev);
>  	umode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
>  	int i;
> -- 
> 2.7.4
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-19 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12  6:55 [PATCH] drivers\power\supply: use kobj_to_dev Wang Qing
2020-06-19 14:57 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).