Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp444049lqb; Thu, 29 Feb 2024 05:49:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW6jKPA32NzjyDMMT5+U2DwamaKt/MPXpfob6To1yeiy3F6Son0yZQw+3iAKCdbzg2ODXbRWJQrefkzCGeoTP4XbEryoxjjnCBRY0x0XQ== X-Google-Smtp-Source: AGHT+IH3b6b5i8vGHZwgCfUNxNqOa3+tWwH4qZcZlkiq82SFSV+xma6lQQ68KQpvay4+xl4uSbcO X-Received: by 2002:a05:6102:38c9:b0:472:7b71:8ab with SMTP id k9-20020a05610238c900b004727b7108abmr2124653vst.28.1709214587997; Thu, 29 Feb 2024 05:49:47 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i17-20020ac84891000000b0042c5c5855e1si1311574qtq.736.2024.02.29.05.49.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 05:49:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86777-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=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=CQ7nlbzH; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-86777-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86777-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 B7DE01C22151 for ; Thu, 29 Feb 2024 13:49:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2F1C1353E3; Thu, 29 Feb 2024 13:49:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CQ7nlbzH" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 2FF2412FB03; Thu, 29 Feb 2024 13:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709214550; cv=none; b=H3xlMcI7A8oenXGDIW30qRJTpLX3cVUBvfxQquOrkejStTu8X7I35lulYH3I9jch4vRnWaVV5a+6Tz3I256H2BIQuBQD3cnJmbKNAo/3CYn04EweemA09wX4DylYTxSidJhbhU2zvbd3MpyZxvf9zFj0Tz2ZMl143KeoHKJWgU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709214550; c=relaxed/simple; bh=gGCDaO4bQHTt76a5KiiGRQz41mE60d5yevJypV2fKy4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HntfsRdxtTXNPtTrrxgYHcprqoBP8wZWvSBAWmDj2+QgwSUCSj5I8qBcutfALpt+Yhd2xGIYuYYX8aahcsyrEK5SfXePhTcedGDCOgapAXdL4Sn3hqO/bwErznw2biC/sa/MU9Q0B9t7Ue+twM0MBDln0wTrrDRZ0Qp2GC0YQzQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=CQ7nlbzH; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709214549; x=1740750549; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=gGCDaO4bQHTt76a5KiiGRQz41mE60d5yevJypV2fKy4=; b=CQ7nlbzHEqcTTk1BuQ9TudiEnW/KETfAgDKq8qEmxJsmmiDHq175w3Kl Ekc18km2qvQ1EdRj6l+kkk4Tz97AunyUJonmGYNmQPfRQhxULDrwA0RZR YHBaBIUUBAWaHlac6Rfc2xRqgLoWjGJGL9UW5ihAVOyo/jjmtVDdYA7T+ yK+nAIMjpG5BUgM+L6ctv6h67+HxUfV4DyoLSDvYfQwJf6BU3ZJR3dnB3 0ZqyPTwfDveVRBKHCWdIL/RHaOmKOciBhLWC7c9BBgiAg3UJWYJZqFT+o BdPCKGkhLuYQtvU5SPfbMivYBxbpeu8XylY68scTEYJKQ7j4hZHgoHan0 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="14835089" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="14835089" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 05:49:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="913982565" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="913982565" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 05:49:03 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rfgmR-00000008gMs-3Ien; Thu, 29 Feb 2024 15:48:59 +0200 Date: Thu, 29 Feb 2024 15:48:59 +0200 From: Andy Shevchenko To: =?iso-8859-1?Q?Th=E9o?= Lebrun Cc: Gregory CLEMENT , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , Linus Walleij , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Philipp Zabel , Vladimir Kondratiev , linux-mips@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , linux-gpio@vger.kernel.org Subject: Re: [PATCH v8 04/10] reset: eyeq5: add platform driver Message-ID: References: <20240227-mbly-clk-v8-0-c57fbda7664a@bootlin.com> <20240227-mbly-clk-v8-4-c57fbda7664a@bootlin.com> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Feb 29, 2024 at 01:18:08PM +0100, Th?o Lebrun wrote: > On Thu Feb 29, 2024 at 12:22 PM CET, Andy Shevchenko wrote: > > On Wed, Feb 28, 2024 at 06:04:47PM +0100, Th?o Lebrun wrote: > > > On Tue Feb 27, 2024 at 6:27 PM CET, Andy Shevchenko wrote: > > > > On Tue, Feb 27, 2024 at 03:55:25PM +0100, Th?o Lebrun wrote: .. > > > > > + priv->rcdev.of_node = np; > > > > > > > > It's better to use device_set_node(). > > > > > > I don't see how device_set_node() can help? It works on struct device > > > pointers. Here priv->rcdev is a reset_controller_dev struct. There are > > > no users of device_set_node() in drivers/reset/. > > > > No users doesn't mean it's good. The API is relatively "new" and takes > > care of two things: > > 1) it uses agnostic interface; > > 2) it doesn't require any firmware node direct dereference. > > > > The 2) is most important here as allows us to refactor (firmware node) code > > in the future. > > I think I get the point of device_set_node(). I still do not understand > how it could help me fill the ->of_node field in a reset_controller_dev > structure? Exactly why I put the above comment as recommendation. And then I elaborated that entire reset framework should rather move towards fwnode. > Should I be using device_set_node() to fill the struct device pointer > and the reset subsystem, by some magic, will pick this up and use it > for its own of_node field? I've not seen any magic/code doing that. At bare minimum it will give beneficial things: 1) less burden in the drivers conversion in case fwnode happens (and I believe it's just matter of time) in reset framework; 2) hiding fwnode/of_node implemetation details (which is currently is layering violation to some extend (as we have a lot of *of_*() APIs to avoid direct access to of_node field in struct device). The downside is that you will need to include property.h for this only thing. And I don't see other code that can be converted to fwnode right away here. -- With Best Regards, Andy Shevchenko