All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] device property: constify fwnode_get_phy_mode() argument
@ 2023-03-24  9:26 Russell King (Oracle)
  2023-03-24 11:14 ` Andy Shevchenko
  2023-03-24 18:12 ` Sakari Ailus
  0 siblings, 2 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2023-03-24  9:26 UTC (permalink / raw)
  To: Andy Shevchenko, Daniel Scally, Heikki Krogerus, Sakari Ailus
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, linux-acpi

fwnode_get_phy_mode() does not modify the fwnode argument, merely
using it to obtain the phy-mode property value. Therefore, it can
be made const.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
Patch generated against net-next tree as that was where it was used and
tested.

 drivers/base/property.c  | 2 +-
 include/linux/property.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index 083a95791d3b..fcc0687f5529 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -895,7 +895,7 @@ EXPORT_SYMBOL_GPL(device_get_dma_attr);
  * 'phy-connection-type', and return its index in phy_modes table, or errno in
  * error case.
  */
-int fwnode_get_phy_mode(struct fwnode_handle *fwnode)
+int fwnode_get_phy_mode(const struct fwnode_handle *fwnode)
 {
 	const char *pm;
 	int err, i;
diff --git a/include/linux/property.h b/include/linux/property.h
index f7100e836eb4..d18c8cc17315 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -396,7 +396,7 @@ enum dev_dma_attr device_get_dma_attr(const struct device *dev);
 const void *device_get_match_data(const struct device *dev);
 
 int device_get_phy_mode(struct device *dev);
-int fwnode_get_phy_mode(struct fwnode_handle *fwnode);
+int fwnode_get_phy_mode(const struct fwnode_handle *fwnode);
 
 void __iomem *fwnode_iomap(struct fwnode_handle *fwnode, int index);
 
-- 
2.30.2


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

* Re: [PATCH] device property: constify fwnode_get_phy_mode() argument
  2023-03-24  9:26 [PATCH] device property: constify fwnode_get_phy_mode() argument Russell King (Oracle)
@ 2023-03-24 11:14 ` Andy Shevchenko
  2023-03-24 18:12 ` Sakari Ailus
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2023-03-24 11:14 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Daniel Scally, Heikki Krogerus, Sakari Ailus, Greg Kroah-Hartman,
	Rafael J. Wysocki, linux-acpi

On Fri, Mar 24, 2023 at 09:26:47AM +0000, Russell King (Oracle) wrote:
> fwnode_get_phy_mode() does not modify the fwnode argument, merely
> using it to obtain the phy-mode property value. Therefore, it can
> be made const.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thank you!

> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
> Patch generated against net-next tree as that was where it was used and
> tested.
> 
>  drivers/base/property.c  | 2 +-
>  include/linux/property.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index 083a95791d3b..fcc0687f5529 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -895,7 +895,7 @@ EXPORT_SYMBOL_GPL(device_get_dma_attr);
>   * 'phy-connection-type', and return its index in phy_modes table, or errno in
>   * error case.
>   */
> -int fwnode_get_phy_mode(struct fwnode_handle *fwnode)
> +int fwnode_get_phy_mode(const struct fwnode_handle *fwnode)
>  {
>  	const char *pm;
>  	int err, i;
> diff --git a/include/linux/property.h b/include/linux/property.h
> index f7100e836eb4..d18c8cc17315 100644
> --- a/include/linux/property.h
> +++ b/include/linux/property.h
> @@ -396,7 +396,7 @@ enum dev_dma_attr device_get_dma_attr(const struct device *dev);
>  const void *device_get_match_data(const struct device *dev);
>  
>  int device_get_phy_mode(struct device *dev);
> -int fwnode_get_phy_mode(struct fwnode_handle *fwnode);
> +int fwnode_get_phy_mode(const struct fwnode_handle *fwnode);
>  
>  void __iomem *fwnode_iomap(struct fwnode_handle *fwnode, int index);
>  
> -- 
> 2.30.2
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] device property: constify fwnode_get_phy_mode() argument
  2023-03-24  9:26 [PATCH] device property: constify fwnode_get_phy_mode() argument Russell King (Oracle)
  2023-03-24 11:14 ` Andy Shevchenko
@ 2023-03-24 18:12 ` Sakari Ailus
  1 sibling, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2023-03-24 18:12 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Greg Kroah-Hartman, Rafael J. Wysocki, linux-acpi

On Fri, Mar 24, 2023 at 09:26:47AM +0000, Russell King (Oracle) wrote:
> fwnode_get_phy_mode() does not modify the fwnode argument, merely
> using it to obtain the phy-mode property value. Therefore, it can
> be made const.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!

Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>

-- 
Sakari Ailus

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

end of thread, other threads:[~2023-03-24 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24  9:26 [PATCH] device property: constify fwnode_get_phy_mode() argument Russell King (Oracle)
2023-03-24 11:14 ` Andy Shevchenko
2023-03-24 18:12 ` Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.