Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp621263lqb; Wed, 17 Apr 2024 06:33:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWuZQAplGvXRjAr2JlEscE9VNngzqLTgJ/F7d2k8ZGuB3cTZ4vUN2pj7zvMKgc4+tYFjfE20GzshhLEFIh16V7uHI3jfFf/ncUFZs4w/g== X-Google-Smtp-Source: AGHT+IGl9Sc5XPTTOec4UBmPvgiY/jHxJ8qaTbdREXGC7Nj+IR2ahnDgaLdS3mfbcpHboaQc6ezF X-Received: by 2002:a05:6358:7c13:b0:17b:f721:4565 with SMTP id p19-20020a0563587c1300b0017bf7214565mr16121628rwf.9.1713360829258; Wed, 17 Apr 2024 06:33:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713360829; cv=pass; d=google.com; s=arc-20160816; b=HrYyMSi+Tjh95qtX1sr0WnIDVRzKoZEImZpzLUcBwBQmzRXlKFsUQNSiUqxXQkNESc HZGs/Cdj9jRhhzhTFOw1yXhbkhbpmLQI1GxZRp4+1cUxlmWstWbQ7UlzOr+zLjUsMwBm Kb7NZydbXrhEyMOZYQCPZBSatWWUVeeqFxeMSvPJNFqZmDp40dgseSGwSR6qiKOEwDVu xMzWdNU5len+2IjV4YH++/WiWRwmWam0+Biaqgfj2YIJqLfxmPhb2S3GkQK0S+VPlg1T cBaJyXPHOnvxynOnKQxcSIl1GQWtElnMTD9ZJ08R1rgyqjpkmsAo3qCtqESwvnGdI1RB lkFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tDenEcxDpfTVugE2/3p0aNgIoEwwlEed+SyaAG2RVEc=; fh=WkkzK+CBKtEeOgyFwsMpc44oFba90CuMF7VXS4nAIdI=; b=BaYfyYRPecq/YSiruYvJ5BTHRv7LJ44RMFvwKvDrGFLdFnnbM+ehpiret+Nt6ARd5/ lQEvNb/Sxyhw225mY7wnUFKn1ozwIlaCLGPnKyYgKWKBjSmRb/mGXg2dt9j7iDQRZ9jd D9zu+Zyi26BgO/3UJqBT+lmBdwGXobOefMpSYHtqWvIAzYx16kYcT78K+wmeG5snAnP/ 7Y0QCjP8iYHiYGljCkRfVJYP7pJXh7/pWGH75AVDvIGZtvrgkfzroXPKsDpdR2lO+Ivi NI43FKL3dxoB7+diEjvqhK/hoFvUG9EKLFcMK/nwds3OLx14mO0xIm/LnQIdHsL0n7d+ APeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f8WHvl68; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-148587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y11-20020ac5cf0b000000b004d412c76338si2039572vke.159.2024.04.17.06.33.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 06:33:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f8WHvl68; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-148587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EF7901C20B34 for ; Wed, 17 Apr 2024 13:33:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E48BC13E02D; Wed, 17 Apr 2024 13:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="f8WHvl68" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1233813173A; Wed, 17 Apr 2024 13:33:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713360782; cv=none; b=df2f+C/SA6jczvugJbLXYwndyM6U2IcpyXlr2r5ozP/zslAtWMQptpJSqaFSAdO5xJWRSrHDUIBfWAk5cfX2pInFHQ1OPFgAZGMUgZH5D48XIuWb9t6T5IIx7p509sUwpjAaQVX2wL3+XvpMaWMuGKlN/kyQPtHzs6id0RpEObA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713360782; c=relaxed/simple; bh=0FAQr3+1ZyvZLqysSDdApJFQe0+RgfkEZ/Lh4fI1GnE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QgQNwJsgL+40lY9H1X+lG0w/zDw0XBDnDDDit+D3M55eiv/ei38gsNlCukfx9H4Q1aUTav+E1F4Xr15sd3Rjy8PlBnuqztnqjATxjLJRtl5rZgoYqx7qKfPFNOPn4wr8wjl46OvagZ9mGSDQcxC5H9YecgKyjejoFVE78SNrcWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=f8WHvl68; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24E66C072AA; Wed, 17 Apr 2024 13:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713360781; bh=0FAQr3+1ZyvZLqysSDdApJFQe0+RgfkEZ/Lh4fI1GnE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f8WHvl68uFX4nxlyi0wiRaglG8F8qQhn71IzAOpEEnlmDOTsivZmG9z89kl2BHYaj JxFdfrFmaYBTalfPEaGu6CiC+JYRcAgubU4ByKQdSdTmM+QPGH2xtk/iwQpE7UQrcH xl6UpOD24d87Pc2xxrsvl23yhIcmyT+Dn7B8z2/0= Date: Wed, 17 Apr 2024 15:32:58 +0200 From: Greg Kroah-Hartman To: Parker Newman Cc: Jiri Slaby , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Parker Newman Subject: Re: [PATCH v3 7/8] serial: exar: add CTI specific setup code Message-ID: <2024041700-engraved-bootie-aca5@gregkh> References: <354ff4aa9d8bdea1a21c503e685e81ac3df48eb8.1713270624.git.pnewman@connecttech.com> <2024041726-fall-debunk-6cc5@gregkh> <20240417091735.17686470@SWDEV2.connecttech.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240417091735.17686470@SWDEV2.connecttech.local> On Wed, Apr 17, 2024 at 09:17:35AM -0400, Parker Newman wrote: > On Wed, 17 Apr 2024 13:24:20 +0200 > Greg Kroah-Hartman wrote: > > > On Tue, Apr 16, 2024 at 08:55:34AM -0400, Parker Newman wrote: > > > struct exar8250 { > > > unsigned int nr; > > > + unsigned int osc_freq; > > > + struct pci_dev *pcidev; > > > + struct device *dev; > > > > Why do you need both a pci_dev and a device? Aren't they the same thing > > here? > > > > I added dev to make the prints cleaner. I personally prefer: > > dev_err(priv->dev, ...); > to > dev_err(&priv->pcidev->dev, ...); > > or to adding a: > struct device *dev = &priv->pcidev->dev; > > to every function just for printing. > > However, I do understand your point. I can drop dev if you prefer. Pick one and stick with it, no need for both. I too like your first option, and if you never need the pci device pointer, just stick with "struct dev". Note, properly reference count it in case you think it could go away from underneath you (some paths it could, so be careful.) > > > +static int cti_tristate_disable(struct exar8250 *priv, unsigned int port_num) > > > +{ > > > + return _cti_set_tristate(priv, port_num, false); > > > +} > > > > Do you ever call _cti_set_tristate() with "true"? > > > > Currently no. However, re-enabling tristate via a custom ioctl was a feature in > our old out-of-tree driver (which was created prior to linux RS485 support). > > I am not sure how it would be activated now, but I left enabling tristate as an > option in to make it easier down the line when we need it. > > I can add a note to the patch or remove it if you would prefer. Just remove it for now, no need to ever add code you "might need in the future", just add that then, when you need it. Code for what you need to do now, that makes things simpler and removes extra stuff that you would have to force others to review :) thanks, greg k-h