From: kbuild test robot <lkp@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, kbuild-all@lists.01.org
Subject: [driver-core:device_h_splitup 34/35] drivers//base/devcon.c:161:40: error: passing argument 2 of 'bus_find_device_by_fwnode' from incompatible pointer type
Date: Mon, 4 Nov 2019 02:16:32 +0800 [thread overview]
Message-ID: <201911040229.HkA0HHhu%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 14582 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git device_h_splitup
head: 8ac09706c581716b3ca938773ad29e50854fa674
commit: bfe8e3fa1f0d3946158a6526aefccc5160b51cb9 [34/35] device.h: move 'struct bus' stuff out to device/bus.h
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
git checkout bfe8e3fa1f0d3946158a6526aefccc5160b51cb9
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
In file included from include/linux/device.h:29:0,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from arch/x86//kernel/irq.c:5:
>> include/linux/device/bus.h:193:62: warning: 'struct fwnode_handle' declared inside parameter list will not be visible outside of this definition or declaration
bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode)
^~~~~~~~~~~~~
--
In file included from include/linux/device.h:29:0,
from drivers//base/devcon.c:9:
>> include/linux/device/bus.h:193:62: warning: 'struct fwnode_handle' declared inside parameter list will not be visible outside of this definition or declaration
bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode)
^~~~~~~~~~~~~
drivers//base/devcon.c: In function 'device_connection_fwnode_match':
>> drivers//base/devcon.c:161:40: error: passing argument 2 of 'bus_find_device_by_fwnode' from incompatible pointer type [-Werror=incompatible-pointer-types]
dev = bus_find_device_by_fwnode(bus, con->fwnode);
^~~
In file included from include/linux/device.h:29:0,
from drivers//base/devcon.c:9:
include/linux/device/bus.h:193:1: note: expected 'const struct fwnode_handle *' but argument is of type 'struct fwnode_handle *'
bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode)
^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/bus_find_device_by_fwnode +161 drivers//base/devcon.c
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 @9 #include <linux/device.h>
637e9e52b185e5 Heikki Krogerus 2019-02-13 10 #include <linux/property.h>
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 11
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 12 static DEFINE_MUTEX(devcon_lock);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 13 static LIST_HEAD(devcon_list);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 14
637e9e52b185e5 Heikki Krogerus 2019-02-13 15 static void *
637e9e52b185e5 Heikki Krogerus 2019-02-13 16 fwnode_graph_devcon_match(struct fwnode_handle *fwnode, const char *con_id,
637e9e52b185e5 Heikki Krogerus 2019-02-13 17 void *data, devcon_match_fn_t match)
637e9e52b185e5 Heikki Krogerus 2019-02-13 18 {
637e9e52b185e5 Heikki Krogerus 2019-02-13 19 struct device_connection con = { .id = con_id };
637e9e52b185e5 Heikki Krogerus 2019-02-13 20 struct fwnode_handle *ep;
637e9e52b185e5 Heikki Krogerus 2019-02-13 21 void *ret;
637e9e52b185e5 Heikki Krogerus 2019-02-13 22
637e9e52b185e5 Heikki Krogerus 2019-02-13 23 fwnode_graph_for_each_endpoint(fwnode, ep) {
637e9e52b185e5 Heikki Krogerus 2019-02-13 24 con.fwnode = fwnode_graph_get_remote_port_parent(ep);
637e9e52b185e5 Heikki Krogerus 2019-02-13 25 if (!fwnode_device_is_available(con.fwnode))
637e9e52b185e5 Heikki Krogerus 2019-02-13 26 continue;
637e9e52b185e5 Heikki Krogerus 2019-02-13 27
637e9e52b185e5 Heikki Krogerus 2019-02-13 28 ret = match(&con, -1, data);
637e9e52b185e5 Heikki Krogerus 2019-02-13 29 fwnode_handle_put(con.fwnode);
637e9e52b185e5 Heikki Krogerus 2019-02-13 30 if (ret) {
637e9e52b185e5 Heikki Krogerus 2019-02-13 31 fwnode_handle_put(ep);
637e9e52b185e5 Heikki Krogerus 2019-02-13 32 return ret;
637e9e52b185e5 Heikki Krogerus 2019-02-13 33 }
637e9e52b185e5 Heikki Krogerus 2019-02-13 34 }
637e9e52b185e5 Heikki Krogerus 2019-02-13 35 return NULL;
637e9e52b185e5 Heikki Krogerus 2019-02-13 36 }
637e9e52b185e5 Heikki Krogerus 2019-02-13 37
fde777791eb83f Heikki Krogerus 2019-05-31 38 static void *
fde777791eb83f Heikki Krogerus 2019-05-31 39 fwnode_devcon_match(struct fwnode_handle *fwnode, const char *con_id,
fde777791eb83f Heikki Krogerus 2019-05-31 40 void *data, devcon_match_fn_t match)
fde777791eb83f Heikki Krogerus 2019-05-31 41 {
fde777791eb83f Heikki Krogerus 2019-05-31 42 struct device_connection con = { };
fde777791eb83f Heikki Krogerus 2019-05-31 43 void *ret;
fde777791eb83f Heikki Krogerus 2019-05-31 44 int i;
fde777791eb83f Heikki Krogerus 2019-05-31 45
fde777791eb83f Heikki Krogerus 2019-05-31 46 for (i = 0; ; i++) {
fde777791eb83f Heikki Krogerus 2019-05-31 47 con.fwnode = fwnode_find_reference(fwnode, con_id, i);
fde777791eb83f Heikki Krogerus 2019-05-31 48 if (IS_ERR(con.fwnode))
fde777791eb83f Heikki Krogerus 2019-05-31 49 break;
fde777791eb83f Heikki Krogerus 2019-05-31 50
fde777791eb83f Heikki Krogerus 2019-05-31 51 ret = match(&con, -1, data);
fde777791eb83f Heikki Krogerus 2019-05-31 52 fwnode_handle_put(con.fwnode);
fde777791eb83f Heikki Krogerus 2019-05-31 53 if (ret)
fde777791eb83f Heikki Krogerus 2019-05-31 54 return ret;
fde777791eb83f Heikki Krogerus 2019-05-31 55 }
fde777791eb83f Heikki Krogerus 2019-05-31 56
fde777791eb83f Heikki Krogerus 2019-05-31 57 return NULL;
fde777791eb83f Heikki Krogerus 2019-05-31 58 }
fde777791eb83f Heikki Krogerus 2019-05-31 59
44493062abc38e Heikki Krogerus 2019-08-29 60 /**
44493062abc38e Heikki Krogerus 2019-08-29 61 * fwnode_connection_find_match - Find connection from a device node
44493062abc38e Heikki Krogerus 2019-08-29 62 * @fwnode: Device node with the connection
44493062abc38e Heikki Krogerus 2019-08-29 63 * @con_id: Identifier for the connection
44493062abc38e Heikki Krogerus 2019-08-29 64 * @data: Data for the match function
44493062abc38e Heikki Krogerus 2019-08-29 65 * @match: Function to check and convert the connection description
44493062abc38e Heikki Krogerus 2019-08-29 66 *
44493062abc38e Heikki Krogerus 2019-08-29 67 * Find a connection with unique identifier @con_id between @fwnode and another
44493062abc38e Heikki Krogerus 2019-08-29 68 * device node. @match will be used to convert the connection description to
44493062abc38e Heikki Krogerus 2019-08-29 69 * data the caller is expecting to be returned.
44493062abc38e Heikki Krogerus 2019-08-29 70 */
44493062abc38e Heikki Krogerus 2019-08-29 71 void *fwnode_connection_find_match(struct fwnode_handle *fwnode,
44493062abc38e Heikki Krogerus 2019-08-29 72 const char *con_id, void *data,
44493062abc38e Heikki Krogerus 2019-08-29 73 devcon_match_fn_t match)
44493062abc38e Heikki Krogerus 2019-08-29 74 {
44493062abc38e Heikki Krogerus 2019-08-29 75 void *ret;
44493062abc38e Heikki Krogerus 2019-08-29 76
44493062abc38e Heikki Krogerus 2019-08-29 77 if (!fwnode || !match)
44493062abc38e Heikki Krogerus 2019-08-29 78 return NULL;
44493062abc38e Heikki Krogerus 2019-08-29 79
44493062abc38e Heikki Krogerus 2019-08-29 80 ret = fwnode_graph_devcon_match(fwnode, con_id, data, match);
44493062abc38e Heikki Krogerus 2019-08-29 81 if (ret)
44493062abc38e Heikki Krogerus 2019-08-29 82 return ret;
44493062abc38e Heikki Krogerus 2019-08-29 83
44493062abc38e Heikki Krogerus 2019-08-29 84 return fwnode_devcon_match(fwnode, con_id, data, match);
44493062abc38e Heikki Krogerus 2019-08-29 85 }
44493062abc38e Heikki Krogerus 2019-08-29 86 EXPORT_SYMBOL_GPL(fwnode_connection_find_match);
44493062abc38e Heikki Krogerus 2019-08-29 87
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 88 /**
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 89 * device_connection_find_match - Find physical connection to a device
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 90 * @dev: Device with the connection
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 91 * @con_id: Identifier for the connection
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 92 * @data: Data for the match function
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 93 * @match: Function to check and convert the connection description
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 94 *
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 95 * Find a connection with unique identifier @con_id between @dev and another
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 96 * device. @match will be used to convert the connection description to data the
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 97 * caller is expecting to be returned.
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 98 */
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 99 void *device_connection_find_match(struct device *dev, const char *con_id,
637e9e52b185e5 Heikki Krogerus 2019-02-13 100 void *data, devcon_match_fn_t match)
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 101 {
637e9e52b185e5 Heikki Krogerus 2019-02-13 102 struct fwnode_handle *fwnode = dev_fwnode(dev);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 103 const char *devname = dev_name(dev);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 104 struct device_connection *con;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 105 void *ret = NULL;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 106 int ep;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 107
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 108 if (!match)
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 109 return NULL;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 110
44493062abc38e Heikki Krogerus 2019-08-29 111 ret = fwnode_connection_find_match(fwnode, con_id, data, match);
637e9e52b185e5 Heikki Krogerus 2019-02-13 112 if (ret)
637e9e52b185e5 Heikki Krogerus 2019-02-13 113 return ret;
fde777791eb83f Heikki Krogerus 2019-05-31 114
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 115 mutex_lock(&devcon_lock);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 116
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 117 list_for_each_entry(con, &devcon_list, list) {
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 118 ep = match_string(con->endpoint, 2, devname);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 119 if (ep < 0)
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 120 continue;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 121
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 122 if (con_id && strcmp(con->id, con_id))
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 123 continue;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 124
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 125 ret = match(con, !ep, data);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 126 if (ret)
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 127 break;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 128 }
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 129
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 130 mutex_unlock(&devcon_lock);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 131
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 132 return ret;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 133 }
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 134 EXPORT_SYMBOL_GPL(device_connection_find_match);
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 135
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 136 extern struct bus_type platform_bus_type;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 137 extern struct bus_type pci_bus_type;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 138 extern struct bus_type i2c_bus_type;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 139 extern struct bus_type spi_bus_type;
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 140
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 141 static struct bus_type *generic_match_buses[] = {
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 142 &platform_bus_type,
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 143 #ifdef CONFIG_PCI
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 144 &pci_bus_type,
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 145 #endif
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 146 #ifdef CONFIG_I2C
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 147 &i2c_bus_type,
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 148 #endif
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 149 #ifdef CONFIG_SPI_MASTER
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 150 &spi_bus_type,
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 151 #endif
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 152 NULL,
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 153 };
f2d9b66d84f3ff Heikki Krogerus 2018-03-20 154
80e04837a40f6f Heikki Krogerus 2019-02-13 155 static void *device_connection_fwnode_match(struct device_connection *con)
80e04837a40f6f Heikki Krogerus 2019-02-13 156 {
80e04837a40f6f Heikki Krogerus 2019-02-13 157 struct bus_type *bus;
80e04837a40f6f Heikki Krogerus 2019-02-13 158 struct device *dev;
80e04837a40f6f Heikki Krogerus 2019-02-13 159
80e04837a40f6f Heikki Krogerus 2019-02-13 160 for (bus = generic_match_buses[0]; bus; bus++) {
67843bbaf36eb0 Suzuki K Poulose 2019-07-23 @161 dev = bus_find_device_by_fwnode(bus, con->fwnode);
80e04837a40f6f Heikki Krogerus 2019-02-13 162 if (dev && !strncmp(dev_name(dev), con->id, strlen(con->id)))
80e04837a40f6f Heikki Krogerus 2019-02-13 163 return dev;
80e04837a40f6f Heikki Krogerus 2019-02-13 164
80e04837a40f6f Heikki Krogerus 2019-02-13 165 put_device(dev);
80e04837a40f6f Heikki Krogerus 2019-02-13 166 }
80e04837a40f6f Heikki Krogerus 2019-02-13 167 return NULL;
80e04837a40f6f Heikki Krogerus 2019-02-13 168 }
80e04837a40f6f Heikki Krogerus 2019-02-13 169
:::::: The code at line 161 was first introduced by commit
:::::: 67843bbaf36eb087714f40e783ee78e99e9e4b86 drivers: Introduce device lookup variants by fwnode
:::::: TO: Suzuki K Poulose <suzuki.poulose@arm.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 7207 bytes --]
[-- Attachment #3: Type: text/plain, Size: 169 bytes --]
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
reply other threads:[~2019-11-03 18:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201911040229.HkA0HHhu%lkp@intel.com \
--to=lkp@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).