From 2246ad16be757e4eaa4a32114ae0b623bb4bf6e2 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 26 Jun 2017 13:51:11 +0200 Subject: [PATCH] Revert "staging: fsl-mc: decouple the mc-bus public headers from dprc.h" This reverts commit c6ce019edb0c9c09b8150011d4f66181952631e9. The whole series is broken, so back it all out. Reported-by: kbuild test robot Cc: Laurentiu Tudor Signed-off-by: Greg Kroah-Hartman --- drivers/staging/fsl-mc/bus/dprc-driver.c | 38 ++++++++--------- drivers/staging/fsl-mc/bus/dprc.c | 3 +- drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 12 +++--- drivers/staging/fsl-mc/bus/fsl-mc-private.h | 2 +- drivers/staging/fsl-mc/include/dprc.h | 46 +++++++++++++++++++-- drivers/staging/fsl-mc/include/mc.h | 41 +----------------- 6 files changed, 71 insertions(+), 71 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c index ff65e70a67a6..80c080f20da1 100644 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c @@ -21,13 +21,13 @@ #define FSL_MC_DPRC_DRIVER_NAME "fsl_mc_dprc" -struct fsl_mc_child_objs { +struct dprc_child_objs { int child_count; - struct fsl_mc_obj_desc *child_array; + struct dprc_obj_desc *child_array; }; static bool fsl_mc_device_match(struct fsl_mc_device *mc_dev, - struct fsl_mc_obj_desc *obj_desc) + struct dprc_obj_desc *obj_desc) { return !strcmp(mc_dev->obj_desc.type, obj_desc->type) && mc_dev->obj_desc.id == obj_desc->id; @@ -36,7 +36,7 @@ static bool fsl_mc_device_match(struct fsl_mc_device *mc_dev, static int __fsl_mc_device_remove_if_not_in_mc(struct device *dev, void *data) { int i; - struct fsl_mc_child_objs *objs; + struct dprc_child_objs *objs; struct fsl_mc_device *mc_dev; WARN_ON(!dev); @@ -45,7 +45,7 @@ static int __fsl_mc_device_remove_if_not_in_mc(struct device *dev, void *data) objs = data; for (i = 0; i < objs->child_count; i++) { - struct fsl_mc_obj_desc *obj_desc = &objs->child_array[i]; + struct dprc_obj_desc *obj_desc = &objs->child_array[i]; if (strlen(obj_desc->type) != 0 && fsl_mc_device_match(mc_dev, obj_desc)) @@ -79,7 +79,7 @@ static int __fsl_mc_device_remove(struct device *dev, void *data) * been dynamically removed in the physical DPRC. */ static void dprc_remove_devices(struct fsl_mc_device *mc_bus_dev, - struct fsl_mc_obj_desc *obj_desc_array, + struct dprc_obj_desc *obj_desc_array, int num_child_objects_in_mc) { if (num_child_objects_in_mc != 0) { @@ -87,7 +87,7 @@ static void dprc_remove_devices(struct fsl_mc_device *mc_bus_dev, * Remove child objects that are in the DPRC in Linux, * but not in the MC: */ - struct fsl_mc_child_objs objs; + struct dprc_child_objs objs; objs.child_count = num_child_objects_in_mc; objs.child_array = obj_desc_array; @@ -105,13 +105,13 @@ static void dprc_remove_devices(struct fsl_mc_device *mc_bus_dev, static int __fsl_mc_device_match(struct device *dev, void *data) { - struct fsl_mc_obj_desc *obj_desc = data; + struct dprc_obj_desc *obj_desc = data; struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev); return fsl_mc_device_match(mc_dev, obj_desc); } -static struct fsl_mc_device *fsl_mc_device_lookup(struct fsl_mc_obj_desc +static struct fsl_mc_device *fsl_mc_device_lookup(struct dprc_obj_desc *obj_desc, struct fsl_mc_device *mc_bus_dev) @@ -136,16 +136,16 @@ static struct fsl_mc_device *fsl_mc_device_lookup(struct fsl_mc_obj_desc * device is unbound from the corresponding device driver. */ static void check_plugged_state_change(struct fsl_mc_device *mc_dev, - struct fsl_mc_obj_desc *obj_desc) + struct dprc_obj_desc *obj_desc) { int error; u32 plugged_flag_at_mc = - obj_desc->state & FSL_MC_OBJ_STATE_PLUGGED; + obj_desc->state & DPRC_OBJ_STATE_PLUGGED; if (plugged_flag_at_mc != - (mc_dev->obj_desc.state & FSL_MC_OBJ_STATE_PLUGGED)) { + (mc_dev->obj_desc.state & DPRC_OBJ_STATE_PLUGGED)) { if (plugged_flag_at_mc) { - mc_dev->obj_desc.state |= FSL_MC_OBJ_STATE_PLUGGED; + mc_dev->obj_desc.state |= DPRC_OBJ_STATE_PLUGGED; error = device_attach(&mc_dev->dev); if (error < 0) { dev_err(&mc_dev->dev, @@ -153,7 +153,7 @@ static void check_plugged_state_change(struct fsl_mc_device *mc_dev, error); } } else { - mc_dev->obj_desc.state &= ~FSL_MC_OBJ_STATE_PLUGGED; + mc_dev->obj_desc.state &= ~DPRC_OBJ_STATE_PLUGGED; device_release_driver(&mc_dev->dev); } } @@ -172,7 +172,7 @@ static void check_plugged_state_change(struct fsl_mc_device *mc_dev, * in the physical DPRC. */ static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev, - struct fsl_mc_obj_desc *obj_desc_array, + struct dprc_obj_desc *obj_desc_array, int num_child_objects_in_mc) { int error; @@ -180,7 +180,7 @@ static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev, for (i = 0; i < num_child_objects_in_mc; i++) { struct fsl_mc_device *child_dev; - struct fsl_mc_obj_desc *obj_desc = &obj_desc_array[i]; + struct dprc_obj_desc *obj_desc = &obj_desc_array[i]; if (strlen(obj_desc->type) == 0) continue; @@ -227,7 +227,7 @@ int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev, int dprc_get_obj_failures; int error; unsigned int irq_count = mc_bus_dev->obj_desc.irq_count; - struct fsl_mc_obj_desc *child_obj_desc_array = NULL; + struct dprc_obj_desc *child_obj_desc_array = NULL; error = dprc_get_obj_count(mc_bus_dev->mc_io, 0, @@ -254,7 +254,7 @@ int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev, */ dprc_get_obj_failures = 0; for (i = 0; i < num_child_objects; i++) { - struct fsl_mc_obj_desc *obj_desc = + struct dprc_obj_desc *obj_desc = &child_obj_desc_array[i]; error = dprc_get_obj(mc_bus_dev->mc_io, @@ -282,7 +282,7 @@ int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev, if ((strcmp(obj_desc->type, "dpseci") == 0) && (obj_desc->ver_major < 4)) obj_desc->flags |= - FSL_MC_OBJ_FLAG_NO_MEM_SHAREABILITY; + DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY; irq_count += obj_desc->irq_count; dev_dbg(&mc_bus_dev->dev, diff --git a/drivers/staging/fsl-mc/bus/dprc.c b/drivers/staging/fsl-mc/bus/dprc.c index a47f31d5ffe6..fcf7b4767dc0 100644 --- a/drivers/staging/fsl-mc/bus/dprc.c +++ b/drivers/staging/fsl-mc/bus/dprc.c @@ -29,7 +29,6 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#include "../include/mc.h" #include "../include/mc-sys.h" #include "../include/mc-cmd.h" #include "../include/dprc.h" @@ -497,7 +496,7 @@ int dprc_get_obj(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, int obj_index, - struct fsl_mc_obj_desc *obj_desc) + struct dprc_obj_desc *obj_desc) { struct mc_command cmd = { 0 }; struct dprc_cmd_get_obj *cmd_params; diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 8725a5cbc3aa..7b48ade1ca9c 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -82,7 +82,7 @@ static int fsl_mc_bus_match(struct device *dev, struct device_driver *drv) * If the object is not 'plugged' don't match. * Only exception is the root DPRC, which is a special case. */ - if ((mc_dev->obj_desc.state & FSL_MC_OBJ_STATE_PLUGGED) == 0 && + if ((mc_dev->obj_desc.state & DPRC_OBJ_STATE_PLUGGED) == 0 && !fsl_mc_is_root_dprc(&mc_dev->dev)) goto out; @@ -339,7 +339,7 @@ static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev, int i; int error; struct resource *regions; - struct fsl_mc_obj_desc *obj_desc = &mc_dev->obj_desc; + struct dprc_obj_desc *obj_desc = &mc_dev->obj_desc; struct device *parent_dev = mc_dev->dev.parent; enum dprc_region_type mc_region_type; @@ -432,7 +432,7 @@ static void fsl_mc_device_release(struct device *dev) /** * Add a newly discovered fsl-mc device to be visible in Linux */ -int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, +int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, struct fsl_mc_io *mc_io, struct device *parent_dev, struct fsl_mc_device **new_mc_dev) @@ -534,7 +534,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, } /* Objects are coherent, unless 'no shareability' flag set. */ - if (!(obj_desc->flags & FSL_MC_OBJ_FLAG_NO_MEM_SHAREABILITY)) + if (!(obj_desc->flags & DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY)) arch_setup_dma_ops(&mc_dev->dev, 0, 0, NULL, true); /* @@ -687,7 +687,7 @@ static int get_mc_addr_translation_ranges(struct device *dev, */ static int fsl_mc_bus_probe(struct platform_device *pdev) { - struct fsl_mc_obj_desc obj_desc; + struct dprc_obj_desc obj_desc; int error; struct fsl_mc *mc; struct fsl_mc_device *mc_bus_dev = NULL; @@ -746,7 +746,7 @@ static int fsl_mc_bus_probe(struct platform_device *pdev) goto error_cleanup_mc_io; } - memset(&obj_desc, 0, sizeof(struct fsl_mc_obj_desc)); + memset(&obj_desc, 0, sizeof(struct dprc_obj_desc)); error = dprc_get_api_version(mc_io, 0, &obj_desc.ver_major, &obj_desc.ver_minor); diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-private.h b/drivers/staging/fsl-mc/bus/fsl-mc-private.h index 7f5406f75908..01ef932905de 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-private.h +++ b/drivers/staging/fsl-mc/bus/fsl-mc-private.h @@ -12,7 +12,7 @@ #include "../include/mc.h" -int __must_check fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, +int __must_check fsl_mc_device_add(struct dprc_obj_desc *obj_desc, struct fsl_mc_io *mc_io, struct device *parent_dev, struct fsl_mc_device **new_mc_dev); diff --git a/drivers/staging/fsl-mc/include/dprc.h b/drivers/staging/fsl-mc/include/dprc.h index 21295e4feb04..2f4a7a75a572 100644 --- a/drivers/staging/fsl-mc/include/dprc.h +++ b/drivers/staging/fsl-mc/include/dprc.h @@ -39,7 +39,6 @@ */ struct fsl_mc_io; -struct fsl_mc_obj_desc; int dprc_open(struct fsl_mc_io *mc_io, u32 cmd_flags, @@ -168,18 +167,59 @@ int dprc_get_obj_count(struct fsl_mc_io *mc_io, u16 token, int *obj_count); +/* Objects Attributes Flags */ + +/* Opened state - Indicates that an object is open by at least one owner */ +#define DPRC_OBJ_STATE_OPEN 0x00000001 +/* Plugged state - Indicates that the object is plugged */ +#define DPRC_OBJ_STATE_PLUGGED 0x00000002 + +/** + * Shareability flag - Object flag indicating no memory shareability. + * the object generates memory accesses that are non coherent with other + * masters; + * user is responsible for proper memory handling through IOMMU configuration. + */ +#define DPRC_OBJ_FLAG_NO_MEM_SHAREABILITY 0x0001 + +/** + * struct dprc_obj_desc - Object descriptor, returned from dprc_get_obj() + * @type: Type of object: NULL terminated string + * @id: ID of logical object resource + * @vendor: Object vendor identifier + * @ver_major: Major version number + * @ver_minor: Minor version number + * @irq_count: Number of interrupts supported by the object + * @region_count: Number of mappable regions supported by the object + * @state: Object state: combination of DPRC_OBJ_STATE_ states + * @label: Object label + * @flags: Object's flags + */ +struct dprc_obj_desc { + char type[16]; + int id; + u16 vendor; + u16 ver_major; + u16 ver_minor; + u8 irq_count; + u8 region_count; + u32 state; + char label[16]; + u16 flags; +}; + int dprc_get_obj(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, int obj_index, - struct fsl_mc_obj_desc *obj_desc); + struct dprc_obj_desc *obj_desc); int dprc_get_obj_desc(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, char *obj_type, int obj_id, - struct fsl_mc_obj_desc *obj_desc); + struct dprc_obj_desc *obj_desc); int dprc_set_obj_irq(struct fsl_mc_io *mc_io, u32 cmd_flags, diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h index 60c706720531..1c46c0c2a895 100644 --- a/drivers/staging/fsl-mc/include/mc.h +++ b/drivers/staging/fsl-mc/include/mc.h @@ -104,45 +104,6 @@ struct fsl_mc_device_irq { #define to_fsl_mc_irq(_mc_resource) \ container_of(_mc_resource, struct fsl_mc_device_irq, resource) -/* Opened state - Indicates that an object is open by at least one owner */ -#define FSL_MC_OBJ_STATE_OPEN 0x00000001 -/* Plugged state - Indicates that the object is plugged */ -#define FSL_MC_OBJ_STATE_PLUGGED 0x00000002 - -/** - * Shareability flag - Object flag indicating no memory shareability. - * the object generates memory accesses that are non coherent with other - * masters; - * user is responsible for proper memory handling through IOMMU configuration. - */ -#define FSL_MC_OBJ_FLAG_NO_MEM_SHAREABILITY 0x0001 - -/** - * struct fsl_mc_obj_desc - Object descriptor - * @type: Type of object: NULL terminated string - * @id: ID of logical object resource - * @vendor: Object vendor identifier - * @ver_major: Major version number - * @ver_minor: Minor version number - * @irq_count: Number of interrupts supported by the object - * @region_count: Number of mappable regions supported by the object - * @state: Object state: combination of FSL_MC_OBJ_STATE_ states - * @label: Object label: NULL terminated string - * @flags: Object's flags - */ -struct fsl_mc_obj_desc { - char type[16]; - int id; - u16 vendor; - u16 ver_major; - u16 ver_minor; - u8 irq_count; - u8 region_count; - u32 state; - char label[16]; - u16 flags; -}; - /** * Bit masks for a MC object device (struct fsl_mc_device) flags */ @@ -189,7 +150,7 @@ struct fsl_mc_device { u16 icid; u16 mc_handle; struct fsl_mc_io *mc_io; - struct fsl_mc_obj_desc obj_desc; + struct dprc_obj_desc obj_desc; struct resource *regions; struct fsl_mc_device_irq **irqs; struct fsl_mc_resource *resource; -- 2.39.2