return ret;
}
-void *dev_get_platdata(struct udevice *dev)
+void *dev_get_platdata(const struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device\n", __func__);
return dev->platdata;
}
-void *dev_get_parent_platdata(struct udevice *dev)
+void *dev_get_parent_platdata(const struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device\n", __func__);
return dev->parent_platdata;
}
-void *dev_get_uclass_platdata(struct udevice *dev)
+void *dev_get_uclass_platdata(const struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device\n", __func__);
return dev->uclass_platdata;
}
-void *dev_get_priv(struct udevice *dev)
+void *dev_get_priv(const struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device\n", __func__);
return dev->priv;
}
-void *dev_get_uclass_priv(struct udevice *dev)
+void *dev_get_uclass_priv(const struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device\n", __func__);
return dev->uclass_priv;
}
-void *dev_get_parent_priv(struct udevice *dev)
+void *dev_get_parent_priv(const struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device\n", __func__);
return 0;
}
-struct udevice *dev_get_parent(struct udevice *child)
+struct udevice *dev_get_parent(const struct udevice *child)
{
return child->parent;
}
-ulong dev_get_driver_data(struct udevice *dev)
+ulong dev_get_driver_data(const struct udevice *dev)
{
return dev->driver_data;
}
-const void *dev_get_driver_ops(struct udevice *dev)
+const void *dev_get_driver_ops(const struct udevice *dev)
{
if (!dev || !dev->driver->ops)
return NULL;
return dev->driver->ops;
}
-enum uclass_id device_get_uclass_id(struct udevice *dev)
+enum uclass_id device_get_uclass_id(const struct udevice *dev)
{
return dev->uclass->uc_drv->id;
}
-const char *dev_get_uclass_name(struct udevice *dev)
+const char *dev_get_uclass_name(const struct udevice *dev)
{
if (!dev)
return NULL;
return dev->uclass->uc_drv->name;
}
-bool device_has_children(struct udevice *dev)
+bool device_has_children(const struct udevice *dev)
{
return !list_empty(&dev->child_head);
}
* @dev Device to check
* @return platform data, or NULL if none
*/
-void *dev_get_platdata(struct udevice *dev);
+void *dev_get_platdata(const struct udevice *dev);
/**
* dev_get_parent_platdata() - Get the parent platform data for a device
* @dev Device to check
* @return parent's platform data, or NULL if none
*/
-void *dev_get_parent_platdata(struct udevice *dev);
+void *dev_get_parent_platdata(const struct udevice *dev);
/**
* dev_get_uclass_platdata() - Get the uclass platform data for a device
* @dev Device to check
* @return uclass's platform data, or NULL if none
*/
-void *dev_get_uclass_platdata(struct udevice *dev);
+void *dev_get_uclass_platdata(const struct udevice *dev);
/**
* dev_get_priv() - Get the private data for a device
* @dev Device to check
* @return private data, or NULL if none
*/
-void *dev_get_priv(struct udevice *dev);
+void *dev_get_priv(const struct udevice *dev);
/**
* dev_get_parent_priv() - Get the parent private data for a device
* @dev Device to check
* @return parent data, or NULL if none
*/
-void *dev_get_parent_priv(struct udevice *dev);
+void *dev_get_parent_priv(const struct udevice *dev);
/**
* dev_get_uclass_priv() - Get the private uclass data for a device
* @dev Device to check
* @return private uclass data for this device, or NULL if none
*/
-void *dev_get_uclass_priv(struct udevice *dev);
+void *dev_get_uclass_priv(const struct udevice *dev);
/**
* struct dev_get_parent() - Get the parent of a device
* @child: Child to check
* @return parent of child, or NULL if this is the root device
*/
-struct udevice *dev_get_parent(struct udevice *child);
+struct udevice *dev_get_parent(const struct udevice *child);
/**
* dev_get_driver_data() - get the driver data used to bind a device
* @dev: Device to check
* @return driver data (0 if none is provided)
*/
-ulong dev_get_driver_data(struct udevice *dev);
+ulong dev_get_driver_data(const struct udevice *dev);
/**
* dev_get_driver_ops() - get the device's driver's operations
* @dev: Device to check
* @return void pointer to driver's operations or NULL for NULL-dev or NULL-ops
*/
-const void *dev_get_driver_ops(struct udevice *dev);
+const void *dev_get_driver_ops(const struct udevice *dev);
/**
* device_get_uclass_id() - return the uclass ID of a device
* @dev: Device to check
* @return uclass ID for the device
*/
-enum uclass_id device_get_uclass_id(struct udevice *dev);
+enum uclass_id device_get_uclass_id(const struct udevice *dev);
/**
* dev_get_uclass_name() - return the uclass name of a device
* @dev: Device to check
* @return pointer to the uclass name for the device
*/
-const char *dev_get_uclass_name(struct udevice *dev);
+const char *dev_get_uclass_name(const struct udevice *dev);
/**
* device_get_child() - Get the child of a device by index
* @dev: Device to check
* @return true if the device has one or more children
*/
-bool device_has_children(struct udevice *dev);
+bool device_has_children(const struct udevice *dev);
/**
* device_has_active_children() - check if a device has any active children