Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4683078rwl; Wed, 28 Dec 2022 07:29:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXsfnwXE7j8irf1K53hcdl3zTIniBFHLIN8kA7tHH2CcS/4dbjBM4KW5pfqKTRiCz4LJy1iN X-Received: by 2002:a05:6a00:1ca7:b0:581:b93c:bb6b with SMTP id y39-20020a056a001ca700b00581b93cbb6bmr480733pfw.7.1672241342466; Wed, 28 Dec 2022 07:29:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672241342; cv=none; d=google.com; s=arc-20160816; b=HQ2D2BbRPUxZ/ViQ9rhnl1axoyhx9khuQmwQjH/RX0j0W0YO3wjVIQwUhNOjMlsU+4 nlwyEf/+DeE/MN+34N7GhhV7+mbQfsnM08qRaBFGmDoL1LWLGUxSjzBufPDHwzzeokfW /7A7stWI1c8VrtGffMAmPuUSX9p8LIDtxcu0K7wz3qYms+Q8y1y82fMPogBCwfpNaOXP nERu4MWm1+V233JB9GrM3b0qGm++kxmjyWL/h5GyB9IP+vc5MCluJ5JDy7MxAAPyhAlr jQJpEY4GLuuzmq6X+UZL3btX8ALsUmcbPtLbTViDPUxV7I7DsRwHfqbDJ+VfzgMAISos ZliA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=DVvWZDmqxBimdIZxVbGPjKCsEnUfUUcWCgdAh6exBjY=; b=03zJ8h1BpUpcjQYumjZpf6fgspjs9NtpYg+GX69N4Waafep18YbTyqaEUZaAEjLCGt U0042x6CLIayCcEwTvIelK4+bIVuZ1o3BQm6WRd52/s7M1eCMSkFGXR2PW+8G/eJ7Uim iMfTIErtAq/Plk7Kh7Qgvwl1aRozQ/Ix8dtGxcILUgKw5kISgTXXVMoWudXRv9hphVEU Um15/xbxYYw+zpHd7Kgm4Ju5+U3JEbtlcaE5N0bMbwsQ9He5OAaTd5QohjdD/z5shc0o XQF0EqXfONVTUgmfaXOLcWKAF6dyTEfmtjsGs8KF287CnVtLV60iXZIwr2GSgB4o2Hx7 cUwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=chOzYeWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a1-20020a056a000c8100b005615ef4cfccsi16519701pfv.185.2022.12.28.07.28.54; Wed, 28 Dec 2022 07:29:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=chOzYeWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233688AbiL1PJk (ORCPT + 64 others); Wed, 28 Dec 2022 10:09:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233712AbiL1PJb (ORCPT ); Wed, 28 Dec 2022 10:09:31 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F0EF13E3D; Wed, 28 Dec 2022 07:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672240160; x=1703776160; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=fdP0nh1OD1wvErCaU7T6b8HwCVcBr17oElrYcEN5+No=; b=chOzYeWml2pigiNoXhR7iH18hvNjoPDmysXlUMSONwzkwBhveK8pZCJu beMMk+a8U1tLMv9XmvbrauN2mfiJVrl1v8jNZ0l3j1mejJcvB+uRKZr2c 44Xpmpl3F8p0eJswfu2kw4Rx8XfvtBCTRraz4as3CzD+3A3ZQ/DuDW+mb GBP0FAMjOu3uLOlgKU9YMElbqoqJS2dv3zo4ymRUZ/97j/MMYKl8AqseF 0uKZcOMmRWr6im/lUn9hburCDF7d1fwK6UpCUJNKgdkM/qq2O8SL4jlrw MTwpn7QZ4/V5IzL9k5QomUt0luJ7b74dz0qBG+A3ZBA6UP/weriUTOany w==; X-IronPort-AV: E=McAfee;i="6500,9779,10574"; a="385309686" X-IronPort-AV: E=Sophos;i="5.96,281,1665471600"; d="scan'208";a="385309686" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2022 07:09:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10574"; a="603359287" X-IronPort-AV: E=Sophos;i="5.96,281,1665471600"; d="scan'208";a="603359287" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP; 28 Dec 2022 07:09:15 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pAY3O-000gDi-0l; Wed, 28 Dec 2022 17:09:14 +0200 Date: Wed, 28 Dec 2022 17:09:13 +0200 From: Andy Shevchenko To: Hanna Hawa Cc: wsa@kernel.org, linus.walleij@linaro.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, dwmw@amazon.co.uk, benh@amazon.com, ronenk@amazon.com, talel@amazon.com, jonnyc@amazon.com, hanochu@amazon.com, farbere@amazon.com, itamark@amazon.com Subject: Re: [PATCH v4 2/2] i2c: Set i2c pinctrl recovery info from it's device pinctrl Message-ID: References: <20221221205116.73941-1-hhhawa@amazon.com> <20221221205116.73941-3-hhhawa@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221221205116.73941-3-hhhawa@amazon.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 21, 2022 at 08:51:16PM +0000, Hanna Hawa wrote: > Currently the i2c subsystem rely on the controller device tree to > initialize the pinctrl recovery information, part of the drivers does > not set this field (rinfo->pinctrl), for example i2c designware driver. DesignWare > The pins information is saved part of the device structure before probe > and it's done on pinctrl_bind_pins(). > > Make the i2c init recovery to get the device pins if it's not > initialized by the driver from the device pins. ... > - struct pinctrl *p = bri->pinctrl; > + struct pinctrl *p; > + > + bri->pinctrl = bri->pinctrl ?: dev_pinctrl(dev->parent); > + p = bri->pinctrl; What about struct pinctrl *p = bri->pinctrl ?: dev_pinctrl(dev->parent); bri->pinctrl = p; ? Seems like one line of code less. Either way, Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko