The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] extcon: lc824206xa: Fix build error of POWER_SUPPLY_PROP_USB_TYPE
@ 2024-09-04 16:15 chanwoo
  2024-09-04 16:21 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: chanwoo @ 2024-09-04 16:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: cw00.choi, myungjoo.ham, hdegoede, Stephen Rothwell

From: Stephen Rothwell <sfr@canb.auug.org.au>

commit 0d9af1e1c93b("power: supply: "usb_type" property may be written to")
changes POWER_SUPPLY_PROP_USB_TYPE from read-only to writtable.
In order to fix build error,

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/extcon/extcon-lc824206xa.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/extcon/extcon-lc824206xa.c b/drivers/extcon/extcon-lc824206xa.c
index d58a2c369018..56938748aea8 100644
--- a/drivers/extcon/extcon-lc824206xa.c
+++ b/drivers/extcon/extcon-lc824206xa.c
@@ -393,14 +393,6 @@ static int lc824206xa_psy_get_prop(struct power_supply *psy,
 	return 0;
 }
 
-static const enum power_supply_usb_type lc824206xa_psy_usb_types[] = {
-	POWER_SUPPLY_USB_TYPE_SDP,
-	POWER_SUPPLY_USB_TYPE_CDP,
-	POWER_SUPPLY_USB_TYPE_DCP,
-	POWER_SUPPLY_USB_TYPE_ACA,
-	POWER_SUPPLY_USB_TYPE_UNKNOWN,
-};
-
 static const enum power_supply_property lc824206xa_psy_props[] = {
 	POWER_SUPPLY_PROP_ONLINE,
 	POWER_SUPPLY_PROP_USB_TYPE,
@@ -410,8 +402,11 @@ static const enum power_supply_property lc824206xa_psy_props[] = {
 static const struct power_supply_desc lc824206xa_psy_desc = {
 	.name = "lc824206xa-charger-detect",
 	.type = POWER_SUPPLY_TYPE_USB,
-	.usb_types = lc824206xa_psy_usb_types,
-	.num_usb_types = ARRAY_SIZE(lc824206xa_psy_usb_types),
+	.usb_types = BIT(POWER_SUPPLY_USB_TYPE_SDP) |
+		     BIT(POWER_SUPPLY_USB_TYPE_CDP) |
+		     BIT(POWER_SUPPLY_USB_TYPE_DCP) |
+		     BIT(POWER_SUPPLY_USB_TYPE_ACA) |
+		     BIT(POWER_SUPPLY_USB_TYPE_UNKNOWN),
 	.properties = lc824206xa_psy_props,
 	.num_properties = ARRAY_SIZE(lc824206xa_psy_props),
 	.get_property = lc824206xa_psy_get_prop,
-- 
2.25.1


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

* Re: [PATCH] extcon: lc824206xa: Fix build error of POWER_SUPPLY_PROP_USB_TYPE
  2024-09-04 16:15 [PATCH] extcon: lc824206xa: Fix build error of POWER_SUPPLY_PROP_USB_TYPE chanwoo
@ 2024-09-04 16:21 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2024-09-04 16:21 UTC (permalink / raw)
  To: chanwoo, linux-kernel; +Cc: cw00.choi, myungjoo.ham, Stephen Rothwell

Hi Chanwoo,

On 9/4/24 6:15 PM, chanwoo@kernel.org wrote:
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> 
> commit 0d9af1e1c93b("power: supply: "usb_type" property may be written to")
> changes POWER_SUPPLY_PROP_USB_TYPE from read-only to writtable.
> In order to fix build error,

Thank you for preparing a fix for this. The commit which is breaking
the build actually is this one:

https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git/commit/?id=364ea7ccaef917a3068236a19a4b31a0623b561a

Codewise this looks good to me, so with the commit-msg fixed to
refer to the correct commit, this is:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  drivers/extcon/extcon-lc824206xa.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-lc824206xa.c b/drivers/extcon/extcon-lc824206xa.c
> index d58a2c369018..56938748aea8 100644
> --- a/drivers/extcon/extcon-lc824206xa.c
> +++ b/drivers/extcon/extcon-lc824206xa.c
> @@ -393,14 +393,6 @@ static int lc824206xa_psy_get_prop(struct power_supply *psy,
>  	return 0;
>  }
>  
> -static const enum power_supply_usb_type lc824206xa_psy_usb_types[] = {
> -	POWER_SUPPLY_USB_TYPE_SDP,
> -	POWER_SUPPLY_USB_TYPE_CDP,
> -	POWER_SUPPLY_USB_TYPE_DCP,
> -	POWER_SUPPLY_USB_TYPE_ACA,
> -	POWER_SUPPLY_USB_TYPE_UNKNOWN,
> -};
> -
>  static const enum power_supply_property lc824206xa_psy_props[] = {
>  	POWER_SUPPLY_PROP_ONLINE,
>  	POWER_SUPPLY_PROP_USB_TYPE,
> @@ -410,8 +402,11 @@ static const enum power_supply_property lc824206xa_psy_props[] = {
>  static const struct power_supply_desc lc824206xa_psy_desc = {
>  	.name = "lc824206xa-charger-detect",
>  	.type = POWER_SUPPLY_TYPE_USB,
> -	.usb_types = lc824206xa_psy_usb_types,
> -	.num_usb_types = ARRAY_SIZE(lc824206xa_psy_usb_types),
> +	.usb_types = BIT(POWER_SUPPLY_USB_TYPE_SDP) |
> +		     BIT(POWER_SUPPLY_USB_TYPE_CDP) |
> +		     BIT(POWER_SUPPLY_USB_TYPE_DCP) |
> +		     BIT(POWER_SUPPLY_USB_TYPE_ACA) |
> +		     BIT(POWER_SUPPLY_USB_TYPE_UNKNOWN),
>  	.properties = lc824206xa_psy_props,
>  	.num_properties = ARRAY_SIZE(lc824206xa_psy_props),
>  	.get_property = lc824206xa_psy_get_prop,


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

end of thread, other threads:[~2024-09-04 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04 16:15 [PATCH] extcon: lc824206xa: Fix build error of POWER_SUPPLY_PROP_USB_TYPE chanwoo
2024-09-04 16:21 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox