From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (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 5216625759; Fri, 8 Mar 2024 14:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709909792; cv=none; b=Wg+FdqksQBTKXFRkrXQ0Eh6SmJJE7swi2+vJPeyflOeyAR8g8hl/kzP5HUur2ORfVtYVwAsZm3eKZ9q8Ve72P0olC7vGL+qxyD10MDVslV4ZU3RjdukQU0u2B6kyvz/Q7hHYWwWrjA69R0pzFZc4oBFI9SmWz0C22/r7YZSKEjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709909792; c=relaxed/simple; bh=duHRboSBY4Ddw2Uqw5pOeQO8eFmgv5M1iTXUTHLZn3g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Bh6k2BL3PHZsbbVv5nyoJgmBzVxG9q2NzqUChFvetpUrOsziZP3QrN3A9QEwEb+Lz3QP7wusi12URLWzNjarqVCwOcqDcM+JMx70OyUYJYnyfPUcHlze8Z6eqpvcKJAsruFW6QxdRPLbLEEPjDgv0nsiMzHruH7gNeYZdcxQH0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1ribdU-0000Wt-1o; Fri, 08 Mar 2024 14:55:48 +0000 Date: Fri, 8 Mar 2024 14:55:44 +0000 From: Daniel Golle To: Avri Altman Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ulf Hansson , Jens Axboe , Dave Chinner , Jan Kara , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Christian Brauner , Li Lingfeng , Damien Le Moal , Min Li , Adrian Hunter , Hannes Reinecke , Christian Loehle , Bean Huo , Yeqi Fu , Victor Shih , Christophe JAILLET , "Ricardo B. Marliere" , Greg Kroah-Hartman , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mmc@vger.kernel.org" , "linux-block@vger.kernel.org" , Diping Zhang , Jianhui Zhao , Jieying Zeng , Chad Monroe , Adam Fox , John Crispin Subject: Re: [RFC PATCH v2 6/8] mmc: core: set card fwnode_handle Message-ID: References: <055787bb6085c32907ee1772522a6bfa49d5d2ef.1709667858.git.daniel@makrotopia.org> Precedence: bulk X-Mailing-List: devicetree@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: On Fri, Mar 08, 2024 at 08:04:54AM +0000, Avri Altman wrote: > > > Set fwnode in case it isn't set yet and of_node is present. > > > > Signed-off-by: Daniel Golle > > --- > > drivers/mmc/core/bus.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index > > 0ddaee0eae54f..e1c5fc1b3ce4b 100644 > > --- a/drivers/mmc/core/bus.c > > +++ b/drivers/mmc/core/bus.c > > @@ -364,6 +364,8 @@ int mmc_add_card(struct mmc_card *card) > > > > mmc_add_card_debugfs(card); > > card->dev.of_node = mmc_of_find_child_device(card->host, 0); > > + if (card->dev.of_node && !card->dev.fwnode) > > + card->dev.fwnode = &card->dev.of_node->fwnode; > Should this be restricted to eMMC only, or is it fine to be called for SD as well? It's always odd to have of_node set and fwnode unset. And also SD cards can be referenced in device tree, resulting in of_node being set but fwnode being unpopulated, which is no more or less weird than for an eMMC. So imho it should always be called and shouldn't hurt.