|
8 | 8 | * The serial core bus manages the serial core controller instances.
|
9 | 9 | */
|
10 | 10 |
|
11 |
| -#include <linux/cleanup.h> |
12 | 11 | #include <linux/container_of.h>
|
13 | 12 | #include <linux/device.h>
|
14 | 13 | #include <linux/idr.h>
|
@@ -205,71 +204,6 @@ void serial_base_port_device_remove(struct serial_port_device *port_dev)
|
205 | 204 | put_device(&port_dev->dev);
|
206 | 205 | }
|
207 | 206 |
|
208 |
| -#ifdef CONFIG_SERIAL_CORE_CONSOLE |
209 |
| - |
210 |
| -static int serial_base_add_one_prefcon(const char *match, const char *dev_name, |
211 |
| - int port_id) |
212 |
| -{ |
213 |
| - int ret; |
214 |
| - |
215 |
| - ret = add_preferred_console_match(match, dev_name, port_id); |
216 |
| - if (ret == -ENOENT) |
217 |
| - return 0; |
218 |
| - |
219 |
| - return ret; |
220 |
| -} |
221 |
| - |
222 |
| -static int serial_base_add_prefcon(const char *name, int idx) |
223 |
| -{ |
224 |
| - const char *char_match __free(kfree) = NULL; |
225 |
| - |
226 |
| - /* Handle the traditional character device name style console=ttyS0 */ |
227 |
| - char_match = kasprintf(GFP_KERNEL, "%s%i", name, idx); |
228 |
| - if (!char_match) |
229 |
| - return -ENOMEM; |
230 |
| - |
231 |
| - return serial_base_add_one_prefcon(char_match, name, idx); |
232 |
| -} |
233 |
| - |
234 |
| -/** |
235 |
| - * serial_base_add_preferred_console - Adds a preferred console |
236 |
| - * @drv: Serial port device driver |
237 |
| - * @port: Serial port instance |
238 |
| - * |
239 |
| - * Tries to add a preferred console for a serial port if specified in the |
240 |
| - * kernel command line. Supports both the traditional character device such |
241 |
| - * as console=ttyS0, and a hardware addressing based console=DEVNAME:0.0 |
242 |
| - * style name. |
243 |
| - * |
244 |
| - * Translates the kernel command line option using a hardware based addressing |
245 |
| - * console=DEVNAME:0.0 to the serial port character device such as ttyS0. |
246 |
| - * Cannot be called early for ISA ports, depends on struct device. |
247 |
| - * |
248 |
| - * Note that duplicates are ignored by add_preferred_console(). |
249 |
| - * |
250 |
| - * Return: 0 on success, negative error code on failure. |
251 |
| - */ |
252 |
| -int serial_base_add_preferred_console(struct uart_driver *drv, |
253 |
| - struct uart_port *port) |
254 |
| -{ |
255 |
| - const char *port_match __free(kfree) = NULL; |
256 |
| - int ret; |
257 |
| - |
258 |
| - ret = serial_base_add_prefcon(drv->dev_name, port->line); |
259 |
| - if (ret) |
260 |
| - return ret; |
261 |
| - |
262 |
| - port_match = kasprintf(GFP_KERNEL, "%s:%i.%i", dev_name(port->dev), |
263 |
| - port->ctrl_id, port->port_id); |
264 |
| - if (!port_match) |
265 |
| - return -ENOMEM; |
266 |
| - |
267 |
| - /* Translate a hardware addressing style console=DEVNAME:0.0 */ |
268 |
| - return serial_base_add_one_prefcon(port_match, drv->dev_name, port->line); |
269 |
| -} |
270 |
| - |
271 |
| -#endif |
272 |
| - |
273 | 207 | static int serial_base_init(void)
|
274 | 208 | {
|
275 | 209 | int ret;
|
|
0 commit comments