From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750950AbdE1QmE (ORCPT ); Sun, 28 May 2017 12:42:04 -0400 Received: from thoth.sbs.de ([192.35.17.2]:39114 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbdE1QmB (ORCPT ); Sun, 28 May 2017 12:42:01 -0400 Subject: Re: [PATCH v3 10/10] serial: exar: Add support for IOT2040 device To: Andy Shevchenko Cc: Greg Kroah-Hartman , Linus Walleij , Alexandre Courbot , Linux Kernel Mailing List , "linux-serial@vger.kernel.org" , "linux-gpio@vger.kernel.org" , Sudip Mukherjee , Sascha Weisenberger References: <8d2c0204ee4ab6040787cb953b30284940eaa2bc.1495814557.git.jan.kiszka@siemens.com> From: Jan Kiszka Message-ID: Date: Sun, 28 May 2017 18:41:52 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-05-27 15:52, Andy Shevchenko wrote: > On Fri, May 26, 2017 at 7:02 PM, Jan Kiszka wrote: >> This implements the setup of RS232 and the switch-over to RS485 or RS422 >> for the Siemens IOT2040. That uses an EXAR XR17V352 with external logic >> to switch between the different modes. The external logic is controlled >> via MPIO pins of the EXAR controller. >> >> Only pin 10 can be exported as GPIO on the IOT2040. It is connected to >> an LED. >> >> As the XR17V352 used on the IOT2040 is not equipped with an external >> EEPROM, it cannot present itself as IOT2040-variant via subvendor/ >> subdevice IDs. Thus, we have to check via DMI for the target platform. > >> static void * >> -xr17v35x_register_gpio(struct pci_dev *pcidev, unsigned int first_pin, >> - unsigned int npins) >> +__xr17v35x_register_gpio(struct pci_dev *pcidev, unsigned int first_pin, >> + unsigned int npins) > >> +static int xr17v35x_register_gpio(struct pci_dev *pcidev, >> + struct uart_8250_port *port) >> +{ >> + if (pcidev->vendor == PCI_VENDOR_ID_EXAR) >> + port->port.private_data = >> + __xr17v35x_register_gpio(pcidev, 0, 16); >> + >> + return 0; >> +} > >> - if (pcidev->vendor == PCI_VENDOR_ID_EXAR) >> - port->port.private_data = >> - xr17v35x_register_gpio(pcidev, 0, 16); >> + ret = platform->register_gpio(pcidev, port); >> } > > Can't you move at least some of this to the patch where you move the check? > This change is unrelated to that patch. What I can offer is a separate patch to factor this out, but I'm not sure it would buy us much. Jan -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux