From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933446AbbLTR3l (ORCPT ); Sun, 20 Dec 2015 12:29:41 -0500 Received: from lxorguk.ukuu.org.uk ([81.2.110.251]:34950 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933384AbbLTR3F (ORCPT ); Sun, 20 Dec 2015 12:29:05 -0500 Date: Sun, 20 Dec 2015 17:28:51 +0000 From: One Thousand Gnomes To: Sudip Mukherjee Cc: Andy Shevchenko , Greg Kroah-Hartman , Jiri Slaby , "linux-kernel@vger.kernel.org" , "linux-serial@vger.kernel.org" Subject: Re: [PATCH v3] serial: 8250: add gpio support to exar Message-ID: <20151220172851.1b560da8@lxorguk.ukuu.org.uk> In-Reply-To: <20151220171104.GA8471@sudip-laptop> References: <1450617891-26167-1-git-send-email-sudipm.mukherjee@gmail.com> <20151220144722.GA26499@sudip-pc> <20151220164131.46fb25ee@lxorguk.ukuu.org.uk> <20151220171104.GA8471@sudip-laptop> Organization: Intel Corporation X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > If you are linking it into the driver you don't need the module_init/exit > > gpio_init/exit methods. Your Kconfig becomes a bool and you combine the > > file into the driver based upon that bool. > > But isn't it better to have the gpio code separete from the 8250 code? > But how do i combine a file? is it like: > > #ifdef SERIAL_8250_EXAR_GPIO > #include "8250_gpio.c" > #endif > > or should it be: > > #ifdef SERIAL_8250_EXAR_GPIO > > all c code > > #endif Neither of the above. Take a look how other parts of the kernel combine multiple files into a single module. It's supported by the Kconfig/Makefile system, and they will get linked together as a single binary while being separate sources. For an example look at drivers/tty/ipwireless Alan