Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp3881640rwj; Tue, 20 Dec 2022 03:17:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf4m+3hKyWNbrV6U+1VUocq12Aci44VXmXqKzERi4R5bx6HbsiqF789F/EYc4u/bt+csOXsr X-Received: by 2002:a05:6a20:9493:b0:ad:d197:59c7 with SMTP id hs19-20020a056a20949300b000add19759c7mr31957460pzb.46.1671535060204; Tue, 20 Dec 2022 03:17:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671535060; cv=none; d=google.com; s=arc-20160816; b=SnkRbxm7dxvs2DiAuYypd33ZYaECGnHVbfCmnt+eBZeCzxA4Felf+fFNYhmSVHhin+ 1ElLy+2xiqOaN3DpvbdC5bH4NoWYL9YBVM6XqBwHE4RetnHX9FeCxbBh8RHaKnnmlQvC iDrsNB7g7b7fkP+SP+eUiAGqe9NQTJNz2Db1eoc8KpmjO/9CVEXit2e7H6C6RDM5P1GF EPOHWRukXU9Nhv8WEUyHdBKowwfv3rDoTvjKAsr07ev89q3undORbyv+edlTilVrQ2BW o72BCZG/hQqpcYZEzUbsaE6TQaAj6Z1Kw2LvHrsU01KVvR2bjKZEnBO3Qsz6LCB1Tt8b d59g== 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=Przf25CJLOwRL4RjgPGfQg4rzwVai+48UyGcsi4byjc=; b=nWdaa+JG+5kJmewSDo3XzNVJ8qNOmWWZIKgjfxYySX/r88T/8pVMIcBm+Oc/9Qv3oV Qonf4NVxLsj0DVQmrZoyPhVvqAdGQDPZDcrFtm2LfogfmbednsMIyw4ZmJl2La8wXXgn SWK+ykz97AfujgJk9vblXCYjBF1EIZsF0cDGd+M5B4X7tNq9mQ8Tn+H57hL3ea+63eRU 5FMW6ZppcpPfPD7EKkfswGQkaiMf3AsMhwp+XRVLX17EPdXDMDi4qdEPykdjRJFKVMTs 9yirQt6eOITPXlV/FmoO5oKKc4thchCH8pAYz7Zfu9kgv5Kksnm83ricnaUEQPgojie7 JoxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Vq7e3Xz3; 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 j8-20020a637a48000000b0046edb8cdbf7si13516159pgn.795.2022.12.20.03.17.30; Tue, 20 Dec 2022 03:17:40 -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=Vq7e3Xz3; 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 S233319AbiLTK54 (ORCPT + 70 others); Tue, 20 Dec 2022 05:57:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233119AbiLTK5z (ORCPT ); Tue, 20 Dec 2022 05:57:55 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 664452BDB; Tue, 20 Dec 2022 02:57:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671533874; x=1703069874; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=juVdS8Pgo8SrrW4tJljdoX0hAgcFCVN4YqxFmDsB+HM=; b=Vq7e3Xz3u2UjS3SrRn0VYw41AJPTkPQT1xOzoGB60ObitSvlawk1bF3P y3TWgt4ePqeoo6ST5i//w3iV1jWjmD/sGEDWBT/tP/UjNX0oLueTbP5fG vL5iW8Q5ahwCYPRqLgk1zhfKUFPQFi7l06bOo8GxHSsXA6P0Dg6d7Hdpd g3Y1dC/Y8X8pHiEmRwQhN3ZL21f+3PzcBxV0xQQROm2IX3fpe9hTWJGpH HN4osXbmlvtA0LQUR4Nheier39ZhX6ILMLrhwL8p/nhf0W4Q72mnHnRw/ 9HFLU/V76CzOC/H0Jfq63gzTiKR1u7dZjgpgpSBTTiD/Tbiw9fdQ/DVkp w==; X-IronPort-AV: E=McAfee;i="6500,9779,10566"; a="307266927" X-IronPort-AV: E=Sophos;i="5.96,259,1665471600"; d="scan'208";a="307266927" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2022 02:57:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10566"; a="681599370" X-IronPort-AV: E=Sophos;i="5.96,259,1665471600"; d="scan'208";a="681599370" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga008.jf.intel.com with ESMTP; 20 Dec 2022 02:57:38 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p7aJU-00Cpgw-0z; Tue, 20 Dec 2022 12:57:36 +0200 Date: Tue, 20 Dec 2022 12:57:36 +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 v3 1/1] i2c: Set pinctrl recovery info to device pinctrl Message-ID: References: <20221219193228.35078-1-hhhawa@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221219193228.35078-1-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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 Mon, Dec 19, 2022 at 07:32:28PM +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. > > 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. > > Added new API to get the device pinctrl. ... > - struct pinctrl *p = bri->pinctrl; > + struct pinctrl *p; > + > + if (!bri->pinctrl) > + bri->pinctrl = dev_pinctrl(dev->parent); > + p = bri->pinctrl; As I said, you may use Elvis here as well. bri->pinctrl = bri->pinctrl ?: dev_pinctrl(...); p = bri->pinctrl; -- With Best Regards, Andy Shevchenko