mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
dm: Rename struct device_id to udevice_id
It is best to avoid having any occurence of 'struct device' in driver model, so rename to achieve this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5957ac2a9f
commit
ae7f451308
|
@ -315,7 +315,7 @@ is little or no 'driver model' code to write.
|
||||||
- Moved some data from code into data structure - e.g. store a pointer to
|
- Moved some data from code into data structure - e.g. store a pointer to
|
||||||
the driver operations structure in the driver, rather than passing it
|
the driver operations structure in the driver, rather than passing it
|
||||||
to the driver bind function.
|
to the driver bind function.
|
||||||
- Rename some structures to make them more similar to Linux (struct device
|
- Rename some structures to make them more similar to Linux (struct udevice
|
||||||
instead of struct instance, struct platdata, etc.)
|
instead of struct instance, struct platdata, etc.)
|
||||||
- Change the name 'core' to 'uclass', meaning U-Boot class. It seems that
|
- Change the name 'core' to 'uclass', meaning U-Boot class. It seems that
|
||||||
this concept relates to a class of drivers (or a subsystem). We shouldn't
|
this concept relates to a class of drivers (or a subsystem). We shouldn't
|
||||||
|
|
|
@ -94,7 +94,7 @@ int lists_bind_drivers(struct udevice *parent)
|
||||||
* tree error
|
* tree error
|
||||||
*/
|
*/
|
||||||
static int driver_check_compatible(const void *blob, int offset,
|
static int driver_check_compatible(const void *blob, int offset,
|
||||||
const struct device_id *of_match)
|
const struct udevice_id *of_match)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ static int shape_ofdata_to_platdata(struct udevice *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct device_id demo_shape_id[] = {
|
static const struct udevice_id demo_shape_id[] = {
|
||||||
{ "demo-shape", 0 },
|
{ "demo-shape", 0 },
|
||||||
{ },
|
{ },
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,7 +32,7 @@ static int demo_shape_ofdata_to_platdata(struct udevice *dev)
|
||||||
return demo_parse_dt(dev);
|
return demo_parse_dt(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct device_id demo_shape_id[] = {
|
static const struct udevice_id demo_shape_id[] = {
|
||||||
{ "demo-simple", 0 },
|
{ "demo-simple", 0 },
|
||||||
{ },
|
{ },
|
||||||
};
|
};
|
||||||
|
|
|
@ -239,7 +239,7 @@ static int gpio_sandbox_probe(struct udevice *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct device_id sandbox_gpio_ids[] = {
|
static const struct udevice_id sandbox_gpio_ids[] = {
|
||||||
{ .compatible = "sandbox,gpio" },
|
{ .compatible = "sandbox,gpio" },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
|
@ -75,11 +75,11 @@ struct udevice {
|
||||||
#define device_active(dev) ((dev)->flags & DM_FLAG_ACTIVATED)
|
#define device_active(dev) ((dev)->flags & DM_FLAG_ACTIVATED)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct device_id - Lists the compatible strings supported by a driver
|
* struct udevice_id - Lists the compatible strings supported by a driver
|
||||||
* @compatible: Compatible string
|
* @compatible: Compatible string
|
||||||
* @data: Data for this compatible string
|
* @data: Data for this compatible string
|
||||||
*/
|
*/
|
||||||
struct device_id {
|
struct udevice_id {
|
||||||
const char *compatible;
|
const char *compatible;
|
||||||
ulong data;
|
ulong data;
|
||||||
};
|
};
|
||||||
|
@ -121,7 +121,7 @@ struct device_id {
|
||||||
struct driver {
|
struct driver {
|
||||||
char *name;
|
char *name;
|
||||||
enum uclass_id id;
|
enum uclass_id id;
|
||||||
const struct device_id *of_match;
|
const struct udevice_id *of_match;
|
||||||
int (*bind)(struct udevice *dev);
|
int (*bind)(struct udevice *dev);
|
||||||
int (*probe)(struct udevice *dev);
|
int (*probe)(struct udevice *dev);
|
||||||
int (*remove)(struct udevice *dev);
|
int (*remove)(struct udevice *dev);
|
||||||
|
|
|
@ -53,7 +53,7 @@ static int testfdt_drv_probe(struct udevice *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct device_id testfdt_ids[] = {
|
static const struct udevice_id testfdt_ids[] = {
|
||||||
{
|
{
|
||||||
.compatible = "denx,u-boot-fdt-test",
|
.compatible = "denx,u-boot-fdt-test",
|
||||||
.data = DM_TEST_TYPE_FIRST },
|
.data = DM_TEST_TYPE_FIRST },
|
||||||
|
|
Loading…
Reference in New Issue
Block a user