lkml.org 
[lkml]   [2022]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 5/5] device property: Constify parameter in device_dma_supported() and device_get_dma_attr()
Date
Constify parameter in device_dma_supported() and device_get_dma_attr()
since they don't alter anything related to it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/base/property.c | 10 +++++-----
include/linux/property.h | 5 ++---
2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index 04eb5e0ab407..5b0417f7e561 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -871,18 +871,18 @@ unsigned int device_get_child_node_count(const struct device *dev)
}
EXPORT_SYMBOL_GPL(device_get_child_node_count);

-bool device_dma_supported(struct device *dev)
+bool device_dma_supported(const struct device *dev)
{
- return fwnode_call_bool_op(dev_fwnode(dev), device_dma_supported);
+ return fwnode_call_bool_op(dev_fwnode_const(dev), device_dma_supported);
}
EXPORT_SYMBOL_GPL(device_dma_supported);

-enum dev_dma_attr device_get_dma_attr(struct device *dev)
+enum dev_dma_attr device_get_dma_attr(const struct device *dev)
{
- if (!fwnode_has_op(dev_fwnode(dev), device_get_dma_attr))
+ if (!fwnode_has_op(dev_fwnode_const(dev), device_get_dma_attr))
return DEV_DMA_NOT_SUPPORTED;

- return fwnode_call_int_op(dev_fwnode(dev), device_get_dma_attr);
+ return fwnode_call_int_op(dev_fwnode_const(dev), device_get_dma_attr);
}
EXPORT_SYMBOL_GPL(device_get_dma_attr);

diff --git a/include/linux/property.h b/include/linux/property.h
index 31dd6cbea9b0..a9498757155d 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -384,9 +384,8 @@ property_entries_dup(const struct property_entry *properties);

void property_entries_free(const struct property_entry *properties);

-bool device_dma_supported(struct device *dev);
-
-enum dev_dma_attr device_get_dma_attr(struct device *dev);
+bool device_dma_supported(const struct device *dev);
+enum dev_dma_attr device_get_dma_attr(const struct device *dev);

const void *device_get_match_data(const struct device *dev);

--
2.35.1
\
 
 \ /
  Last update: 2022-09-28 13:00    [W:0.050 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site