Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1826383ybl; Thu, 5 Dec 2019 07:37:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwqOMEdHIvJlqv77N6q7awzqruWe/922qHZkevnYd+0qEWAtiWUeMwQW2Njh15OTV25mpUK X-Received: by 2002:a9d:6c81:: with SMTP id c1mr5692055otr.39.1575560277738; Thu, 05 Dec 2019 07:37:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575560277; cv=none; d=google.com; s=arc-20160816; b=wUA2CfE3PZJLK3ysRN/nMalEaNZG0ld1VYApPQjkuH/ETnJJma5PbSIZiS35v7PQHB 7TIZv+ZEtQpnhZL3Mcke5/PjE4h1plvPoMa8YeR62eZj/wefZset5mMvL1Bjb/PcDLYo dygYobjKl9Iv1S5rWvc1K6KzIsL+CxJk5tM0c0ejnmJpCdQazKDmn2DPD1BT/+NyhnD8 dgaN3DttLHtPFSPeRw4KGi07M7hqnncIFRlpEGpkHR+GIyPlNwVyccC2XbNIyZKcX5Jl fz/N5hh8ZJ7HcHHZaFnrLx5LiqTaZj3Q/Jo9zdqOaZ5Wu02TPJykRcKyeg5fn4seVgRJ 3Yjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kPIfmI6YmC37nFfkHhfjosxMMyLCEna1y4+NMiXko+Q=; b=C0tGTNReOaUrG/aUftMPW/sofcgQMBqKxq2qRRw1m6uKfc1wNqbHNAv5uvXZLggl4R qk3UJFLKqDiuQGchVlqBw2zy1frajb3ccZ/akKerkOr6B3XJTjd2+OMVEqvogBzNlqKQ kQ6UJkM6bshkaoIsNPSQ3v9zwucIawl48oTHaBqwHEcm7wAiYvJYy+Y496mqZGZsN0Pd 8uUvFs0H+A4tdeiA43U+KPyj+ctKgxHTVnzBhHJm7q/rq6cMgZQH3mS8Q2ktWfYcp3nB GEeiFUtpChHWt8tE7hoWWdBh4TKhQIJ6KmyRgpS++y+OjjEabgLU4oO4kf0t0zPBRqUd 2TNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=afZoFyU8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si5120978otr.166.2019.12.05.07.37.45; Thu, 05 Dec 2019 07:37:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=afZoFyU8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729587AbfLEPhC (ORCPT + 99 others); Thu, 5 Dec 2019 10:37:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:34390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726028AbfLEPhC (ORCPT ); Thu, 5 Dec 2019 10:37:02 -0500 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0D9E924648; Thu, 5 Dec 2019 15:37:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575560221; bh=8g5WQaj4R8Z6JbCzii1HHDVdWvegq5C0/h5DPZauWrA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=afZoFyU8oAIo1hr36eD0VKgwP7ZPm6YNcHaBrsSzoxWdBW7+ijPvI72HvK4s3Y+2C 1HSl5VGvnN97CjaRiXNcZNNLrxXRF3AbRFZrhB20jOjHGiSjZNy6nPs5DkfRKM4/4P Err56hIxQp/XVz+/IXOxdm3+Pe+4LFnDCPaKPAzk= Received: by mail-lf1-f41.google.com with SMTP id b15so2836027lfc.4; Thu, 05 Dec 2019 07:37:00 -0800 (PST) X-Gm-Message-State: APjAAAXVd7WTaD38Dzxi2K0Q+xuvHf2L7F6j3WrY+e9zQQHOIJDBVMKb KKF2/OQxELwAunei1MD7UE45xusJSAmuLaurNV8= X-Received: by 2002:a05:6512:1dd:: with SMTP id f29mr1692900lfp.106.1575560219202; Thu, 05 Dec 2019 07:36:59 -0800 (PST) MIME-Version: 1.0 References: <20191201075914.23512-1-kkoos00@naver.com> <20191201080314.GA3716559@kroah.com> In-Reply-To: <20191201080314.GA3716559@kroah.com> From: Krzysztof Kozlowski Date: Thu, 5 Dec 2019 16:36:48 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] tty: serial: samsung: support driver modulization To: Greg KH Cc: Hyunki Koo , jslaby@suse.com, linux-serial@vger.kernel.org, "linux-kernel@vger.kernel.org" , kkoos00@gmail.com, Shinbeom Choi , Hyunki Koo Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 1 Dec 2019 at 09:05, Greg KH wrote: > > On Sun, Dec 01, 2019 at 04:59:14PM +0900, Hyunki Koo wrote: > > From: Shinbeom Choi > > > > This commit enables modulization of samsung uart driver. > > > > There was no way to make use of this driver in other module, > > because uart functions were static. > > > > By exporting required functions, user can use this driver > > in other module. > > > > Signed-off-by: Shinbeom Choi > > Signed-off-by: Hyunki Koo > > --- > > drivers/tty/serial/samsung.h | 32 ++++++++++++ > > drivers/tty/serial/samsung_tty.c | 85 +++++++++++++++----------------- > > 2 files changed, 73 insertions(+), 44 deletions(-) > > > > diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h > > index f93022113f59..25be0962284d 100644 > > --- a/drivers/tty/serial/samsung.h > > +++ b/drivers/tty/serial/samsung.h > > @@ -144,4 +144,36 @@ static inline void s3c24xx_clear_bit(struct uart_port *port, int idx, > > local_irq_restore(flags); > > } > > > > +#if defined(CONFIG_ARCH_EXYNOS) > > +#define EXYNOS_COMMON_SERIAL_DRV_DATA \ > > + .info = &(struct s3c24xx_uart_info) { \ > > + .name = "Samsung Exynos UART", \ > > + .type = PORT_S3C6400, \ > > + .has_divslot = 1, \ > > + .rx_fifomask = S5PV210_UFSTAT_RXMASK, \ > > + .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \ > > + .rx_fifofull = S5PV210_UFSTAT_RXFULL, \ > > + .tx_fifofull = S5PV210_UFSTAT_TXFULL, \ > > + .tx_fifomask = S5PV210_UFSTAT_TXMASK, \ > > + .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, \ > > + .def_clk_sel = S3C2410_UCON_CLKSEL0, \ > > + .num_clks = 1, \ > > + .clksel_mask = 0, \ > > + .clksel_shift = 0, \ > > + }, \ > > + .def_cfg = &(struct s3c2410_uartcfg) { \ > > + .ucon = S5PV210_UCON_DEFAULT, \ > > + .ufcon = S5PV210_UFCON_DEFAULT, \ > > + .has_fracval = 1, \ > > + } \ > > + > > +#endif > > + > > +int s3c24xx_serial_get_ports(struct s3c24xx_uart_port **ourport, int index); > > +int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, > > + struct platform_device *platdev); > > +int s3c24xx_serial_unregister_port(struct platform_device *dev); > > +int s3c24xx_serial_suspend(struct device *dev); > > +int s3c24xx_serial_resume(struct device *dev); > > +int s3c24xx_serial_resume_noirq(struct device *dev); > > #endif > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c > > index 83fd51607741..15414ecd9008 100644 > > --- a/drivers/tty/serial/samsung_tty.c > > +++ b/drivers/tty/serial/samsung_tty.c > > @@ -1735,7 +1735,7 @@ static int s3c24xx_serial_enable_baudclk(struct s3c24xx_uart_port *ourport) > > * initialise a single serial port from the platform device given > > */ > > > > -static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, > > +int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, > > struct platform_device *platdev) > > { > > struct uart_port *port = &ourport->port; > > @@ -1842,12 +1842,24 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, > > /* reset the fifos (and setup the uart) */ > > s3c24xx_serial_resetport(port, cfg); > > > > + if (!s3c24xx_uart_drv.state) { > > + ret = uart_register_driver(&s3c24xx_uart_drv); > > + if (ret < 0) { > > + dev_err(port->dev, "Failed to register Samsung UART driver\n"); > > + return ret; > > + } > > + } > > + > > + dbg("%s: adding port\n", __func__); > > + uart_add_one_port(&s3c24xx_uart_drv, &ourport->port); > > + > > return 0; > > > > err: > > port->mapbase = 0; > > return ret; > > } > > +EXPORT_SYMBOL_GPL(s3c24xx_serial_init_port); > > Why are you exporting all of these functions? What other code uses > them? Why are you converting them all to global functions I don't see > any other in-kernel callers, so why are those changes needed here? > > totally confused, I cannot find the original email from Hyunki on mailing lists (neither LKML nor serial) so this was not even public till Greg replied. Anyway, probably this is for new Android and some out-of-tree usage... but it is wrong. Best regards, Krzysztof