Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

can: etas_es58x: remove es58x_get_product_info()

Now that the product information are available under devlink, no more
need to print them in the kernel log. Remove es58x_get_product_info().

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/all/20221130174658.29282-7-mailhol.vincent@wanadoo.fr
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Vincent Mailhol and committed by
Marc Kleine-Budde
d8f26fd6 9f06631c

+3 -49
+3 -49
drivers/net/can/usb/etas_es58x/es58x_core.c
··· 2142 2142 } 2143 2143 2144 2144 /** 2145 - * es58x_get_product_info() - Get the product information and print them. 2146 - * @es58x_dev: ES58X device. 2147 - * 2148 - * Do a synchronous call to get the product information. 2149 - * 2150 - * Return: zero on success, errno when any error occurs. 2151 - */ 2152 - static int es58x_get_product_info(struct es58x_device *es58x_dev) 2153 - { 2154 - struct usb_device *udev = es58x_dev->udev; 2155 - const int es58x_prod_info_idx = 6; 2156 - /* Empirical tests show a prod_info length of maximum 83, 2157 - * below should be more than enough. 2158 - */ 2159 - const size_t prod_info_len = 127; 2160 - char *prod_info; 2161 - int ret; 2162 - 2163 - prod_info = kmalloc(prod_info_len, GFP_KERNEL); 2164 - if (!prod_info) 2165 - return -ENOMEM; 2166 - 2167 - ret = usb_string(udev, es58x_prod_info_idx, prod_info, prod_info_len); 2168 - if (ret < 0) { 2169 - dev_err(es58x_dev->dev, 2170 - "%s: Could not read the product info: %pe\n", 2171 - __func__, ERR_PTR(ret)); 2172 - goto out_free; 2173 - } 2174 - if (ret >= prod_info_len - 1) { 2175 - dev_warn(es58x_dev->dev, 2176 - "%s: Buffer is too small, result might be truncated\n", 2177 - __func__); 2178 - } 2179 - dev_info(es58x_dev->dev, "Product info: %s\n", prod_info); 2180 - 2181 - out_free: 2182 - kfree(prod_info); 2183 - return ret < 0 ? ret : 0; 2184 - } 2185 - 2186 - /** 2187 2145 * es58x_init_es58x_dev() - Initialize the ES58X device. 2188 2146 * @intf: USB interface. 2189 2147 * @driver_info: Quirks of the device. ··· 2219 2261 const struct usb_device_id *id) 2220 2262 { 2221 2263 struct es58x_device *es58x_dev; 2222 - int ch_idx, ret; 2264 + int ch_idx; 2223 2265 2224 2266 es58x_dev = es58x_init_es58x_dev(intf, id->driver_info); 2225 2267 if (IS_ERR(es58x_dev)) 2226 2268 return PTR_ERR(es58x_dev); 2227 2269 2228 - ret = es58x_get_product_info(es58x_dev); 2229 - if (ret) 2230 - return ret; 2231 - 2232 2270 es58x_parse_product_info(es58x_dev); 2233 2271 devlink_register(priv_to_devlink(es58x_dev)); 2234 2272 2235 2273 for (ch_idx = 0; ch_idx < es58x_dev->num_can_ch; ch_idx++) { 2236 - ret = es58x_init_netdev(es58x_dev, ch_idx); 2274 + int ret = es58x_init_netdev(es58x_dev, ch_idx); 2237 2275 if (ret) { 2238 2276 es58x_free_netdevs(es58x_dev); 2239 2277 return ret; 2240 2278 } 2241 2279 } 2242 2280 2243 - return ret; 2281 + return 0; 2244 2282 } 2245 2283 2246 2284 /**