Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4607990rwo; Tue, 25 Jul 2023 08:25:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlHqe5whwyAkBBfVva9/468oVM4cctfv6Xs11yNv5W/lZyMuUPEvvUbFHZjil3KEVIPP1pNT X-Received: by 2002:a05:6402:40f:b0:522:3149:159b with SMTP id q15-20020a056402040f00b005223149159bmr3116517edv.2.1690298730249; Tue, 25 Jul 2023 08:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690298730; cv=none; d=google.com; s=arc-20160816; b=ikl5xagXwKeMjocGF8A4tSqy5oLM/NgAYcrKlUQhvoQEC892kG2M8mHTtUVykGBB7O P2OHHKn2j0tDTO3ouvlMtXoQva2bfDNWdwRuJypeKhNY7dIwxj1rr9r8sP3PhoHj7nSf fmYRRUUgMFTfReqvfrqYW05QXwuDlWIDjT6VV3UNI5Jzmr2ZFesCgaAg6MjGrYiYF3GA q6wYxzvO6PQxOJOS7QorWXRzenPy+072DR7PLj7c1theS5SLMBy1DK6ahQJJvD4C0zxT QuAw5w2H4M1hvjp8/L3uWEGf4umoILkJs+PoeO8p3+bBFalSlfttPMdOg6oKCN14kI0l w5pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=Yc4H+0G+6pbyEOqSql7utPUvhs4BREL4FC5e6Cqe0wI=; fh=98ldnqYmygHFAu011R/YTI1xSjEYMq+glb2NLK4SXpM=; b=fOv08Owrvu0ez+AyyDC4Bn5Ldn/Uhr7K6HWqT0xorfG1CQ3TyjhlsyKAp6Cbw3Nw4t lRBJnppPXXX5dKX2zisG2+umKT+CYpEKjStOCJcn9vAuCqO3XBkLRMrJjRggZHLVvhwI 388ZHtpbld5/nTakmZoNQzOyW4dplZrqX4bo/0PVE1II4C8lIWQMoDnbSo6oPi57B2P+ 5JcXXQj5NQruPOCqjN5PydR3aTGeQAEodCw6n8VbM52WlFFkCl9A7AE8h6Ae+PvEV0ZK WtNZT8ggdvh+yoIIyoM6hdisxLbYZ8Mebn2cMlgTC3DMg/UTZuM3xOra3J+uJVuezdGs bUwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=hZ4Dq9Jt; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020aa7d28d000000b0051de4a33c6bsi9113943edq.470.2023.07.25.08.25.06; Tue, 25 Jul 2023 08:25:30 -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; dkim=pass header.i=@weissschuh.net header.s=mail header.b=hZ4Dq9Jt; 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 S232705AbjGYOVH (ORCPT + 99 others); Tue, 25 Jul 2023 10:21:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230474AbjGYOUu (ORCPT ); Tue, 25 Jul 2023 10:20:50 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76FEA2697; Tue, 25 Jul 2023 07:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1690294648; bh=6N3Sq6NeH6BbaiavR7O3xkbcCrkvZ1yXDKwPR9c54IU=; h=From:Date:Subject:To:Cc:From; b=hZ4Dq9Jty0CBm1B7i/IztsQxrb73cmHBaM0NYBp6fvT7DGdtx4mBfmmMS14ZkvrRv ppxfYAfBsRvn6Ys+FkI1lEnTclH/udPHoMyCawp4j4ds11iUF4x6qMKGIwe6MQaCPy S2JRsDZ8eJaxyi3f7dj4asyV+jEMrXaeyLkATuVY= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 25 Jul 2023 16:17:25 +0200 Subject: [PATCH] mmc: core: propagate removable attribute to driver core MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230725-mmc-removable-v1-1-b2e0c4f18e6d@weissschuh.net> X-B4-Tracking: v=1; b=H4sIAHTZv2QC/x3MQQqAIBBA0avIrBPMsKirRAvTsQZSQ0EC6e5Jy 7f4v0LGRJhhYRUSFsoUQ0PfMTCnDgdyss0ghRzEJBX33vCEPha9X8iVcdboGa0YJbTmTujo+X/ r9r4fQjtuzl8AAAA= To: Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690294647; l=1153; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=6N3Sq6NeH6BbaiavR7O3xkbcCrkvZ1yXDKwPR9c54IU=; b=ccSN6txL/80O9P0/RQTEBgYopVxGhLEMhnyOhucPYN3wxQW7b+nj4Az6lPuzFezzvZvisQThA DTD/f6hfMyGC1EklsVkc0zaRopPw7Ki5/6PnPxDhwo+zFkoxk0MG8db X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Userspace can use this to distinguish hotpluggable mmc devices such as sdcards from non-hotpluggable ones such as eMMC. One example is the lsblk tool from util-linux. Note that dev_set_removable() is not related to GENHD_FL_REMOVABLE which is not applicable as per the comment in drivers/mmc/core/block.c Link: https://github.com/util-linux/util-linux/issues/2379 Signed-off-by: Thomas Weißschuh --- drivers/mmc/core/bus.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 2c3074a605fc..0af96548e7da 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -310,6 +310,9 @@ int mmc_add_card(struct mmc_card *card) dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host), card->rca); + dev_set_removable(&card->dev, + mmc_card_is_removable(card->host) ? + DEVICE_REMOVABLE : DEVICE_FIXED); switch (card->type) { case MMC_TYPE_MMC: --- base-commit: 0b5547c51827e053cc754db47d3ec3e6c2c451d2 change-id: 20230725-mmc-removable-5cfdca9ed062 Best regards, -- Thomas Weißschuh