From patchwork Fri Oct 1 05:01:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514981 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp450932jaf; Thu, 30 Sep 2021 22:03:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwb3N1hpyExibzx3aTlBhaQiaNLisnz4AKsTn2yDblsM5yi3diJL6IaPOx33D5hhv7OJPvk X-Received: by 2002:aa7:db8a:: with SMTP id u10mr1030053edt.189.1633064616289; Thu, 30 Sep 2021 22:03:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064616; cv=none; d=google.com; s=arc-20160816; b=yc7groLAeby23IQmo4LnuLXcXlPISUB8q9W5K4WOd0nzV3zGmv7nCs8hgbWvdIXXm3 qUx9ke7/KfciJt+Fc/+fRqoQ6baPffrXbxwcgBOwEYYdB6fqyDCYcMINF7/LCsDJ9VBe Jivx7gZHFTvbzf6IDx9LYDS2WzB84m/L+a9CT4N//+9dV2N8ngAFK+AyZrmcNtA4uwVz s6IcBVLGDHinBVbbZNg290a7JZKYrGC8KmKme+GChuqJ03IeStS2AaZlTOsrWKVtD87W fDolAyoP2GSPBtKznGFdHF92jvqpIVfL+jlW9YJfkEM7eDNFKWSgqvEArk8dtuNSntOo V4ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z/s8T5Z2+8B0u0/BcispJFM9kCTqYbxHAZfCLDDXxgk=; b=VxtfF1FhHVVHRFT+EiLyblou/SWteYoBn4l6tl6wIKENl/FAQ/hvHCTlZvs1U2HXP8 xpOOvJZGk8/mG00wGg1X8sSOGUhpOOjXN7nsjMbOnM62/vG0NX29J3pgvOPwZtQWb3Tw 1S5dBagdXRl43YxSgQykwQTacAdcrlHCnCc+0KJRDuixL9uawb6l/fK2T6LrMpfvxDeU MhH1hglwu3Q604IQWrOf4A/O4fpSOxXXwVQGIpBjlnlj13HgPY9gR4MvMBAU6t0ZCYNI Ko6k3OQ+z8D9E3T29eNrpee7BmNNJH7Aw14puwKurXhyoFnlCHuzMuX3CDHvzIcxLnZG +d2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkbJ9YyE; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a26si5955483ejv.66.2021.09.30.22.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:36 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkbJ9YyE; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D554582C88; Fri, 1 Oct 2021 07:03:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="kkbJ9YyE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5A53E81FAD; Fri, 1 Oct 2021 07:03:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EC25481FA9 for ; Fri, 1 Oct 2021 07:03:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pg1-x529.google.com with SMTP id h3so8348962pgb.7 for ; Thu, 30 Sep 2021 22:03:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z/s8T5Z2+8B0u0/BcispJFM9kCTqYbxHAZfCLDDXxgk=; b=kkbJ9YyE6Cfp3skV0G4JfRf53mXWKS/jBJRANlkT2xkpSvc7K8KjIyoHu8/hPVO+gV 86C16haDx/GpxeDF6gu7yDvTnuVgvdozMe88rawnQ4lfVAiQQwbjDq/xHD/5JLwZa0gS 9NyICKNrR60g3JB+JjRl1xcc5ApxVtyDx6NDMwlpVeKrFh82Pvhy2Xy9Nnsc2AGP5sdd 2QEbUNXdWw4aFMRIsF0BWCRkDsAe2vEfNRUwt5x0zp6NQ3T8fGa/g0YkciMZhZLngxxF +zUyPeDRsss7gKJcZuinjP8KQqx+CYXWjQA+DUhcevTB4Sixxzn1N1HDqTHNLVLPBPxx Yqjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z/s8T5Z2+8B0u0/BcispJFM9kCTqYbxHAZfCLDDXxgk=; b=WxYlubq4sSmm5sSblXQhfy9DVffUuGekjeU3UmhxXho+1/1mnxDRtQjnhq9Dx2IJCa HVRpE0EkTDcMXhvMX7kxi0F+SJuxShKRMCbAe8cw4ngeInyQuCSN+ZWUTQJblcRdFu9B 0fed42hL1noqQEzDPFta58xG6bh/jgIkxxiJo1DbSTgnNOAVwN4u/0DlDqabrDZA1Qjg DjHzTnrdofp7QsgtK3+YweiVHvdQ+3L5OLrnj/HzLD54O/SfTioTzLOYqlsf3aQNYFB7 y+ro4ndYs92fcTuLqlS8q1aAM+m0qHvD1ryKoOEtNZcXcsJ2iI2a3JHR26YeXiaXZnOc cyMQ== X-Gm-Message-State: AOAM5314AkFaLGX7micIWXfgffPkl6ue6jWdkZtwxbFII6vFLZDBTrEQ LtRBWKijQW49cKyTtdkj3c4xsw== X-Received: by 2002:a63:1d23:: with SMTP id d35mr8073215pgd.357.1633064579820; Thu, 30 Sep 2021 22:02:59 -0700 (PDT) Received: from localhost.localdomain (122-100-26-52m5.mineo.jp. [122.100.26.52]) by smtp.gmail.com with ESMTPSA id z8sm4615113pgc.53.2021.09.30.22.02.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:02:59 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [RFC 02/22] usb: storage: call device_probe() after scanning Date: Fri, 1 Oct 2021 14:01:48 +0900 Message-Id: <20211001050228.55183-5-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001050228.55183-1-takahiro.akashi@linaro.org> References: <20211001050228.55183-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Every time a usb bus/port is scanned and a new device is detected, we want to call device_probe() as it will give us a chance to run additional post-processings for some purposes. In particular, support for creating partitions on a device will be added. Signed-off-by: AKASHI Takahiro --- common/usb_storage.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.33.0 diff --git a/common/usb_storage.c b/common/usb_storage.c index 946c6b2b323a..5f294f17491f 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -239,6 +239,12 @@ static int usb_stor_probe_device(struct usb_device *udev) if (ret) return ret; } + + ret = device_probe(dev); + if (ret) { + device_unbind(dev); + return ret; + } } #else /* We don't have space to even probe if we hit the maximum */