From patchwork Wed Jul 19 22:02:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 122861 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2743914vqt; Wed, 19 Jul 2023 15:27:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlF2xJe/BCRq9o86hqUQDk9rkfYlszq0eKOQrn43BkdMjf1bd5uaYcSUP95LLdyiryfuL4Mh X-Received: by 2002:a05:6402:1283:b0:51d:e1cf:dc8a with SMTP id w3-20020a056402128300b0051de1cfdc8amr463996edv.22.1689805634799; Wed, 19 Jul 2023 15:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689805634; cv=none; d=google.com; s=arc-20160816; b=K/2W2W3/3lcNBxWxD7cRjSEKZ5H8yUqsyq+T6WUSmO7q8XMRBepeHH35i1nZfBT8ke MGguj8RGl6jiF/I3jI34QQwit/cJ8QDHwJJ8CeZzF2KYhYsChlkWak/Vi3ISOgQZ2Srs PF7xeh8A2RMSsh4Ka4+L2Sv6B5xGuQsjYn2nSFKliX4kNvtbTjstOXLngkBzMeQkwDOZ BcHuqxfpN9B2/nIvVIavVSCeL27LFOxPe03L0rR4piYJdWZfbQjqzIIrL8ZYiclDiazY YocvJfhwxkJG3tmT04TmeTtC0dZzthh2T6WanU3x06XaiCyZm9QiybEppWWIreqYT1WT b+ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date; bh=tXYT4uAYKkmC7cZff6dBIrrvsJsYT9JZconVxKgdMQ0=; fh=O/hjEvlM0nIN8LC6WbIQ4s0L6nmnRMOzajXXMF81As0=; b=oCRucd+de//4wafo4N5pFCkSbYhQcUofS1kVYxfHWXZu+C2GI4ixomCHgR3yJng8ko NqQTbe0AXrJanAm5dHClJYx5shtAaYdiZbDCui+ISZOa6DhmGtDvW2QKMMDN1laY2Dsu YUqrzCAo2AphOFQSS75/2lWj5ZQAMtOIkvo51mOdXMzmCNt5p8hYlVF9GOaxGQsqNiH7 VzESJeDnWMRv2cEnhV2Aff1JEqB/LjWcDkqrCkHGsR52W2eY9fO3KN47iEbBQpFP1E+/ 93lnaQ6KGCQZ1tjSbO2ehSPNWwh5Q1LgwBJPbcw+xmH1GbTJVjD2MiaFNhKCfYE9e143 yrKA== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u19-20020aa7d893000000b00521d23adb1asi802808edq.258.2023.07.19.15.26.51; Wed, 19 Jul 2023 15:27:14 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230212AbjGSWD1 (ORCPT + 99 others); Wed, 19 Jul 2023 18:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230211AbjGSWDY (ORCPT ); Wed, 19 Jul 2023 18:03:24 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88BDA2122; Wed, 19 Jul 2023 15:03:19 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qMFG1-0008Ji-2q; Wed, 19 Jul 2023 22:02:53 +0000 Date: Wed, 19 Jul 2023 23:02:45 +0100 From: Daniel Golle To: Jens Axboe , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dave Chinner , Matthew Wilcox , Thomas =?iso-8859-1?q?Wei=DFschuh?= , Jan Kara , Daniel Golle , Damien Le Moal , Ming Lei , Min Li , Christian Loehle , Adrian Hunter , Hannes Reinecke , Jack Wang , Florian Fainelli , Yeqi Fu , Avri Altman , Hans de Goede , Ye Bin , Greg Kroah-Hartman , =?utf-8?b?UmFmYcWCIE1pxYJl?= =?utf-8?b?Y2tp?= , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [RFC PATCH 2/6] mmc: block: set fwnode of disk devices Message-ID: <1ce5f56df546cec25ef741f381286f1d7c33d000.1689802933.git.daniel@makrotopia.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771889633452101286 X-GMAIL-MSGID: 1771889633452101286 Set fwnode of disk devices to 'block', 'boot0' and 'boot1' subnodes of the mmc-card. This is done in preparation for having the eMMC act as NVMEM provider. Signed-off-by: Daniel Golle --- drivers/mmc/core/block.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index f701efb1fa785..fc1a9f31bd253 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -2413,6 +2413,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, int area_type, unsigned int part_type) { + struct fwnode_handle *fwnode; + struct device *ddev; struct mmc_blk_data *md; int devidx, ret; char cap_str[10]; @@ -2509,6 +2511,12 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, blk_queue_write_cache(md->queue.queue, cache_enabled, fua_enabled); + ddev = disk_to_dev(md->disk); + fwnode = device_get_named_child_node(subname ? md->parent->parent : + md->parent, + subname ? subname : "block"); + ddev->fwnode = fwnode; + string_get_size((u64)size, 512, STRING_UNITS_2, cap_str, sizeof(cap_str)); pr_info("%s: %s %s %s%s\n",