summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-03-25 18:21:54 (GMT)
committerSimon Glass <sjg@chromium.org>2015-04-18 17:11:19 (GMT)
commit3479253dad2ac9d1c71f4843aae52ea7cd0c7716 (patch)
tree332ecc5cc4d545a14cc0097b44bc51d432001842
parent2c03c4633b092d695d04bd38053da4d7dc59a9a5 (diff)
downloadu-boot-fsl-qoriq-3479253dad2ac9d1c71f4843aae52ea7cd0c7716.tar.xz
dm: core: Convert driver_bind() to use const
The driver is not modified by driver model, so update driver_bind() to recognise that. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
-rw-r--r--drivers/core/device-remove.c4
-rw-r--r--drivers/core/device.c7
-rw-r--r--include/dm/device-internal.h2
-rw-r--r--include/dm/device.h2
4 files changed, 8 insertions, 7 deletions
diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index 3a5f48d..7fee1c0 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -66,7 +66,7 @@ static int device_chld_remove(struct udevice *dev)
int device_unbind(struct udevice *dev)
{
- struct driver *drv;
+ const struct driver *drv;
int ret;
if (!dev)
@@ -139,7 +139,7 @@ void device_free(struct udevice *dev)
int device_remove(struct udevice *dev)
{
- struct driver *drv;
+ const struct driver *drv;
int ret;
if (!dev)
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 1ca5d1c..f1a03d9 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -24,8 +24,9 @@
DECLARE_GLOBAL_DATA_PTR;
-int device_bind(struct udevice *parent, struct driver *drv, const char *name,
- void *platdata, int of_offset, struct udevice **devp)
+int device_bind(struct udevice *parent, const struct driver *drv,
+ const char *name, void *platdata, int of_offset,
+ struct udevice **devp)
{
struct udevice *dev;
struct uclass *uc;
@@ -181,7 +182,7 @@ static void *alloc_priv(int size, uint flags)
int device_probe_child(struct udevice *dev, void *parent_priv)
{
- struct driver *drv;
+ const struct driver *drv;
int size = 0;
int ret;
int seq;
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index e2418fe..687462b 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -34,7 +34,7 @@ struct udevice;
* @devp: Returns a pointer to the bound device
* @return 0 if OK, -ve on error
*/
-int device_bind(struct udevice *parent, struct driver *drv,
+int device_bind(struct udevice *parent, const struct driver *drv,
const char *name, void *platdata, int of_offset,
struct udevice **devp);
diff --git a/include/dm/device.h b/include/dm/device.h
index f27b34b..fafecce 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -70,7 +70,7 @@ struct driver_info;
* when the device is probed and will be unique within the device's uclass.
*/
struct udevice {
- struct driver *driver;
+ const struct driver *driver;
const char *name;
void *platdata;
void *parent_platdata;