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>
This commit is contained in:
Simon Glass 2015-03-25 12:21:54 -06:00
parent 2c03c4633b
commit 3479253dad
4 changed files with 8 additions and 7 deletions

View File

@ -66,7 +66,7 @@ static int device_chld_remove(struct udevice *dev)
int device_unbind(struct udevice *dev) int device_unbind(struct udevice *dev)
{ {
struct driver *drv; const struct driver *drv;
int ret; int ret;
if (!dev) if (!dev)
@ -139,7 +139,7 @@ void device_free(struct udevice *dev)
int device_remove(struct udevice *dev) int device_remove(struct udevice *dev)
{ {
struct driver *drv; const struct driver *drv;
int ret; int ret;
if (!dev) if (!dev)

View File

@ -24,8 +24,9 @@
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
int device_bind(struct udevice *parent, struct driver *drv, const char *name, int device_bind(struct udevice *parent, const struct driver *drv,
void *platdata, int of_offset, struct udevice **devp) const char *name, void *platdata, int of_offset,
struct udevice **devp)
{ {
struct udevice *dev; struct udevice *dev;
struct uclass *uc; 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) int device_probe_child(struct udevice *dev, void *parent_priv)
{ {
struct driver *drv; const struct driver *drv;
int size = 0; int size = 0;
int ret; int ret;
int seq; int seq;

View File

@ -34,7 +34,7 @@ struct udevice;
* @devp: Returns a pointer to the bound device * @devp: Returns a pointer to the bound device
* @return 0 if OK, -ve on error * @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, const char *name, void *platdata, int of_offset,
struct udevice **devp); struct udevice **devp);

View File

@ -70,7 +70,7 @@ struct driver_info;
* when the device is probed and will be unique within the device's uclass. * when the device is probed and will be unique within the device's uclass.
*/ */
struct udevice { struct udevice {
struct driver *driver; const struct driver *driver;
const char *name; const char *name;
void *platdata; void *platdata;
void *parent_platdata; void *parent_platdata;