generic: mtd: backport SPI_NOR_HAS_LOCK
[openwrt/openwrt.git] / target / linux / layerscape / patches-4.4 / 7184-staging-fsl-mc-make-fsl_mc_is_root_dprc-global.patch
1 From 82981b28f3a8a7f4ac61d8dc87a0abaeebfbe6dc Mon Sep 17 00:00:00 2001
2 From: Stuart Yoder <stuart.yoder@nxp.com>
3 Date: Wed, 22 Jun 2016 16:40:47 -0500
4 Subject: [PATCH 184/226] staging: fsl-mc: make fsl_mc_is_root_dprc() global
5
6 make fsl_mc_is_root_dprc() global so that the dprc driver
7 can use it
8
9 Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
10 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
11 ---
12 drivers/staging/fsl-mc/bus/mc-bus.c | 28 +++++++++++++---------------
13 drivers/staging/fsl-mc/include/mc.h | 2 ++
14 2 files changed, 15 insertions(+), 15 deletions(-)
15
16 --- a/drivers/staging/fsl-mc/bus/mc-bus.c
17 +++ b/drivers/staging/fsl-mc/bus/mc-bus.c
18 @@ -24,8 +24,6 @@
19
20 static struct kmem_cache *mc_dev_cache;
21
22 -static bool fsl_mc_is_root_dprc(struct device *dev);
23 -
24 /**
25 * fsl_mc_bus_match - device to driver matching callback
26 * @dev: the MC object device structure to match against
27 @@ -247,19 +245,6 @@ static void fsl_mc_get_root_dprc(struct
28 }
29 }
30
31 -/**
32 - * fsl_mc_is_root_dprc - function to check if a given device is a root dprc
33 - */
34 -static bool fsl_mc_is_root_dprc(struct device *dev)
35 -{
36 - struct device *root_dprc_dev;
37 -
38 - fsl_mc_get_root_dprc(dev, &root_dprc_dev);
39 - if (!root_dprc_dev)
40 - return false;
41 - return dev == root_dprc_dev;
42 -}
43 -
44 static int get_dprc_attr(struct fsl_mc_io *mc_io,
45 int container_id, struct dprc_attributes *attr)
46 {
47 @@ -424,6 +409,19 @@ error_cleanup_regions:
48 }
49
50 /**
51 + * fsl_mc_is_root_dprc - function to check if a given device is a root dprc
52 + */
53 +bool fsl_mc_is_root_dprc(struct device *dev)
54 +{
55 + struct device *root_dprc_dev;
56 +
57 + fsl_mc_get_root_dprc(dev, &root_dprc_dev);
58 + if (!root_dprc_dev)
59 + return false;
60 + return dev == root_dprc_dev;
61 +}
62 +
63 +/**
64 * Add a newly discovered MC object device to be visible in Linux
65 */
66 int fsl_mc_device_add(struct dprc_obj_desc *obj_desc,
67 --- a/drivers/staging/fsl-mc/include/mc.h
68 +++ b/drivers/staging/fsl-mc/include/mc.h
69 @@ -207,6 +207,8 @@ int __must_check fsl_mc_allocate_irqs(st
70
71 void fsl_mc_free_irqs(struct fsl_mc_device *mc_dev);
72
73 +bool fsl_mc_is_root_dprc(struct device *dev);
74 +
75 extern struct bus_type fsl_mc_bus_type;
76
77 #endif /* _FSL_MC_H_ */