Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3374110pxu; Tue, 15 Dec 2020 05:41:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNMBuTTP0qfFkRNI7kOZjK6xG1oDIi5Qy52SlGSuePfU1ah7mA2Axy5V13EKB3JFrYDAp/ X-Received: by 2002:a17:906:5609:: with SMTP id f9mr14092067ejq.535.1608039713473; Tue, 15 Dec 2020 05:41:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608039713; cv=none; d=google.com; s=arc-20160816; b=icty2rC8iw/vG1xDI+P5dQ0RTyCTKrkR5ZMl41R3D0l+CLOwj55JoHBoGHdp1FutDK kobe/xlnz91875HLe/IXhpzh4HF9094lgYD8YL33RurA9oRhQxy6t6fsr1PjzGWJoZvk /aUa4Rwn80dDGLtX0tcm/k+p+SL4O9fnlk7+ZhK2SAJP+mebirLb8fBGSyS1RqykYZV7 Ke+Ymze736tD4VO5I4S0AiSl3qDTRaRtLK5+/CdK9cpCVFDxg/w43as03u+bCQEFk9FB j+tMgf9xEXCCv0b09HAiEgOv3tt27njKEddhdQ9MbVYwBcU95FmBD8RLsBmXFB9vKylc t4uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=8QAL8MOcyZ9zDdQtHRvtasScNpboReHI9VZQi17oCqI=; b=giT/OLhIhYW/mkBqF5Z61+2tVVlkHk/pH5SUhntK8Mu+b0K5AjwXWcaDWp9kuZS8OF 1gmLWm+wzRBxtwG4KeS1UOZ0HDNi68+c23QgI1VDK7XXQA6Eh/a3Owby6erQPDqxMfg5 JQrzFhVtGLCq91hLOogOGJIxWi6vZhAmKpde+dQZPJnbL28gGmhF8GA8IOrz09Sa9cHb Q0Q2Vm+SO7gCvCsip9qID+j7fDw0Ff/VsnVj0Y8WJrrgi/BiW129+qirjRRnNAEOjrNJ +7Lob0L3GVNaKP/1lEyZ6SyvCnc9vJT9nnkTzdWkCbZR9YwcvIWsIB22yvghPo1adHku E5VA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=asem.it Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm11si826427ejb.442.2020.12.15.05.41.29; Tue, 15 Dec 2020 05:41:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=asem.it Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728501AbgLONgb convert rfc822-to-8bit (ORCPT + 99 others); Tue, 15 Dec 2020 08:36:31 -0500 Received: from smtp.asem.it ([151.1.184.197]:63398 "EHLO smtp.asem.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728382AbgLONgT (ORCPT ); Tue, 15 Dec 2020 08:36:19 -0500 Received: from webmail.asem.it by asem.it (smtp.asem.it) (SecurityGateway 6.5.2) with ESMTP id SG000670418.MSG for ; Tue, 15 Dec 2020 14:35:32 +0100S Received: from ASAS044.asem.intra (172.16.16.44) by ASAS044.asem.intra (172.16.16.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 15 Dec 2020 14:35:31 +0100 Received: from ASAS044.asem.intra ([::1]) by ASAS044.asem.intra ([::1]) with mapi id 15.01.1979.003; Tue, 15 Dec 2020 14:35:31 +0100 From: Flavio Suligoi To: Greg Kroah-Hartman CC: Jiri Slaby , "Gustavo A . R . Silva" , Ji-Ze Hong , "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: R: [PATCH v1] serial: 8250_fintek: Print Fintek chip name Thread-Topic: [PATCH v1] serial: 8250_fintek: Print Fintek chip name Thread-Index: AQHW0hsm4LBjpzgBaEuoNhCE3PXG1an2iQoAgAGZwAA= Date: Tue, 15 Dec 2020 13:35:31 +0000 Message-ID: References: <20201214131445.954822-1-f.suligoi@asem.it> In-Reply-To: Accept-Language: it-IT, en-US Content-Language: it-IT X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.17.208] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-SGHeloLookup-Result: pass smtp.helo=webmail.asem.it (ip=172.16.16.44) X-SGSPF-Result: none (smtp.asem.it) X-SGOP-RefID: str=0001.0A782F16.5FD8BBA4.0043,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 (_st=1 _vt=0 _iwf=0) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, > > > > switch (chip) { > > case CHIP_ID_F81865: > > + chip_name = "F81865"; > > + break; > > case CHIP_ID_F81866: > > + chip_name = "F81866"; > > + break; > > case CHIP_ID_F81966: > > + chip_name = "F81966"; > > + break; > > case CHIP_ID_F81216AD: > > + chip_name = "F81216AD"; > > + break; > > case CHIP_ID_F81216H: > > + chip_name = "F81216H"; > > + break; > > case CHIP_ID_F81216: > > + chip_name = "F81216"; > > break; > > default: > > return -ENODEV; > > } > > > > pdata->pid = chip; > > + > > + pr_info("%s%s%s Fintek %s\n", > > + uart->port.dev ? dev_name(uart->port.dev) : "", > > + uart->port.dev ? ": " : "", > > + uart->port.name, > > + chip_name); > > Drivers, if all goes well, should not print anything to the kernel log. > This isn't ok. > > And even if it was, dev_info() would be the correct thing to do... Ok, too many information in the driver. But what do you think about the possibility to introduce a new additional field, in "serial8250_config" structure, such as "extra_name" or something like this: struct serial8250_config { const char *name; const char *extra_name; unsigned short fifo_size; unsigned short tx_loadsz; unsigned char fcr; unsigned char rxtrig_bytes[UART_FCR_R_TRIG_MAX_STATE]; unsigned int flags; }; In this way, if required, each driver can fill this additional field, for example adding the name of the particular uart chip or other useful info. As result, for example, the "uart_report_port" function output could be something like this: 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A - Fintek F81216AD 00:02: ttyS3 at I/O 0x2e8 (irq = 11, base_baud = 115200) is a 16550A - Fintek F81216AD where the "extra_name", if not empty, is printed at the end of the line. For practical space reasons, the "extra_name" length can be limited to 16 chars. > > thanks, > > greg k-h Thanks and best regards, Flavio