From patchwork Fri Oct 1 05:01:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 514983 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp451166jaf; Thu, 30 Sep 2021 22:04:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcTqBVUhSafgWbaZ+5rf72KXujNc1mBOw92wL2qKKMHebHAoWXAQ//H4+iixnFoQKsV0m1 X-Received: by 2002:a05:6402:4245:: with SMTP id g5mr7800429edb.158.1633064641638; Thu, 30 Sep 2021 22:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064641; cv=none; d=google.com; s=arc-20160816; b=USH/fjvHe4JG7uT2rEspH/mVTqNcWfclWoXHrAlKvXgwrThPtLNfSWA8esYnNTepGR 72yFgQtTJu2/G6rRgFpKIzBAwyTgd9leFTc3sHWdYyQeoBjtl1emFuXvY/8lXUNUQAms Zjo/kydjyuEptRJGssaap0KkfcNqOXNR01ecXJ7xM0DEOpwxpGHaLgHdm6w3zqLJm+aP A1hf6Jdowd7biFRy7eGRDaHf3Lpop1qQd3WPJe+W+Lc3QJZKiM79AUw8PdJ3j4CbNR0h +d1cqCxBn4vSTtjoou+MBA4G2F7ui1yLV+UqtBQ13GXMnbOBjLw2j+dp8xgWj01ullcK XEZg== 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=TH1Ja5Lgy07NSUx+/lywfNrEKdlPhvtZhG0N2NdakdfiQ7glqmHlBHsbePgM3LQPN3 IQsPN0jd81SmfV9vDxADxaaR4YtNs4mIpteqE1CnGjdkqyFV4LRtvGB1J4+3T/yBO1bd dgBuLMN7BkV3aiSCl2h4ZNj7L2Y6Df/355YPFhV1am821U3HzgV3WOVKCn6ARWU4DiVX +FRAwiebY2q5PoRXLm1ip/+Q1ovcWALsO2siPZLjNX+S264AFmA6WMt3cHPOtrtcxlFe BxBHZ3n1OMtOunxEmikTxqrO3exGlGUlhKL/KNokYfzv9kUCn5UYqGKoWRSLkMqx6CSo mbHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lkNvDi6e; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id w12si6343538edl.180.2021.09.30.22.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:01 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lkNvDi6e; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 9E81E82EBB; Fri, 1 Oct 2021 07:03:25 +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="lkNvDi6e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB0E582982; Fri, 1 Oct 2021 07:03:13 +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-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (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 33E86820E3 for ; Fri, 1 Oct 2021 07:03:08 +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-pj1-x102b.google.com with SMTP id ce20-20020a17090aff1400b0019f13f6a749so8117082pjb.4 for ; Thu, 30 Sep 2021 22:03:08 -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=lkNvDi6eoYgi/RacS1i2blLiDEvBIydqyUpoiDAGu5TzO97dQ99QFccMfY6p2Tvvpp T94BOg5C3vHO9YCncleO4N/lccxPzerCBbN9cRKKpQvNkz6Ie70ZL8CZuLOxeK7z5QUS eSLkbHaxtoMstbEhu6K5wQUoxWL01XtCoeBo7Eu9RbB7UtdnKdBij0A6scWQvvUoCAuw PE+anHVBUUAJyxcMLIW8QWFJsq+bPXNpuZYtt4pAiXJYJQvVqHbXrTrbkyxFMav2zkEV abRDVCRFHCO0rH7aVToEd9Wr+Z/QRb+UKO/DZjzVVXP2r9dGmg85Gh6JNCrPBrMeMJ9L 8xFQ== 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=1ED2QqhCMI50P+a/jlxOuT5MviSbvDtK2TOpp0IBprbCZPpAzTpPWBlNSz5cLDR/S3 xt8gx+ZZtcuO8VHy71P3aZ5K40KdNsj6mazb04Aae+d1euV6JY6s0Qd7d55yKWY5UlOS MFlzUZG2l+fKbXmR3GHMrOWr3KUfb8tpo0uC9e08Sf5mnBhEfk60/byLrVp36W9kMfts 3a9vTK1dAV7DTdVs2nyckidVncqPWkv2mite9Hxi57uXV7xW6qGiEhn8VHRpht3GOFbR uJg11FH+sDp+Cgnf5/Au96TDy/wgPOq4Z6fa7BB3L1Uks3FMQo2yI/KhGwzedmPYrbHt WMgQ== X-Gm-Message-State: AOAM533j6iLw3yEvAhdNelYUg0y9pNFf9h3sHJxb6ENx1tOp4eOlfpuN ViIOz6J6uj+An6Q4dLBwU1Kt0A== X-Received: by 2002:a17:90a:4812:: with SMTP id a18mr17444865pjh.40.1633064586449; Thu, 30 Sep 2021 22:03:06 -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.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:03:05 -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 03/22] usb: storage: call device_probe() after scanning Date: Fri, 1 Oct 2021 14:01:50 +0900 Message-Id: <20211001050228.55183-7-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 Reviewed-by: Simon Glass 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 */