Message ID | 20201222103224.9018-2-m.szyprowski@samsung.com |
---|---|
State | Accepted |
Commit | f21358ad6cb5d39fff432fa0af0c4fd24288b2b7 |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp5206482jai; Tue, 22 Dec 2020 02:33:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7vnsh5NeKNN9beveKdlfnGIS+63OPMaZkibQ81cu46grLkqPCMO04vFBZvFV9h5PzoBZu X-Received: by 2002:a17:906:234d:: with SMTP id m13mr19350266eja.270.1608633233972; Tue, 22 Dec 2020 02:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608633233; cv=none; d=google.com; s=arc-20160816; b=tnvX28KJTiRdIErskpjDXmIqUbl7etz8IcV4biSMGE7axvMZM3O1Y3cwg/LElbM0yg 1soUoCrl/0IO90fS9Ku1qm8xYpHRP9HYEmAu3u5ITTODITvod2EwcNtwie+6ht/7CpSy 9e1lWTQz419wghvnzW+3IqlArS98bfzXljxWi+AVcJPB2e1PCgQzhLEbtFdnMmGE1ytJ UkYuqu2UyW9HRsL97UHAg3lRdCCvum3aWj7Yua/ZfGsBJ2MfPokEWdCloLfu4332OY6V wZAszsjTl98RgSKCoHzgLVgS++W0DCO/9xtD0wIE0Unf/fL9BK7MoNVrG+zJ4qJ7w1ue 28fA== 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:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=MxT3AujAex65msl7ZgW5g5E+GqdY6NnpkjtkNalxiXY=; b=QCA1z+PNOnhjG+tYVvwnEdIKrMMbIHDrVnrznUaiJ4YGY51tVVWOewT2GROjH55P6G 6YTmHh/7abiImv4l7atgitCScD+WwYQCQlhSCGsZu2Tk/KwHpV0yAL0AWpTlAENfRRvJ aEXJG4xh/oPQFBiWGhArLj/97/Zv1T/x3E2+Q/CXVDwf/G1ZRmpttpRaLdR8w2gpMWEE Q1YQDUinsnQb+dFhjD7xYBSTXSqRUVyc+2oLWTimXahw/AG/42ItQdJqVD2gIVmyNJvH SUCg1nBcpc1xHYp/OQhx9DoNeaxaiyBxEb9YsGFUrHiFnHL5W5Rp6DGep69yvky/4X36 utuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=lwin7Bl8; 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=samsung.com Return-Path: <u-boot-bounces@lists.denx.de> Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id dk28si11277521edb.336.2020.12.22.02.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 02:33:53 -0800 (PST) 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=@samsung.com header.s=mail20170921 header.b=lwin7Bl8; 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=samsung.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 47F9B82A67; Tue, 22 Dec 2020 11:33:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="lwin7Bl8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2ED4982A35; Tue, 22 Dec 2020 11:32:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DEC1282A36 for <u-boot@lists.denx.de>; Tue, 22 Dec 2020 11:32:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=m.szyprowski@samsung.com Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201222103235euoutp02bc18d3f3222440f409d1e10809b4b3cd~TA1TpEv6g0281402814euoutp02d for <u-boot@lists.denx.de>; Tue, 22 Dec 2020 10:32:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201222103235euoutp02bc18d3f3222440f409d1e10809b4b3cd~TA1TpEv6g0281402814euoutp02d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608633155; bh=MxT3AujAex65msl7ZgW5g5E+GqdY6NnpkjtkNalxiXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lwin7Bl8yxf82NbonMjPmV3MKLDbHXsWUcEVQsoQ308DghSSz/+hrgzxsyH15mF8v YcHwvPBxRuBoBJjRSvgSMDFKJ4HikqWln839kNCWR9A3A/L5WiM/SpcGWj+oSiNp76 GOAAx7dulm/6FExpUOzplLypHn88eok8DUpngg8M= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201222103234eucas1p23ae2c7597b6a48d863c6ee84ec077bb1~TA1Tb2WGv2802328023eucas1p2P; Tue, 22 Dec 2020 10:32:34 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id CD.40.44805.24BC1EF5; Tue, 22 Dec 2020 10:32:34 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201222103234eucas1p208db1186f9c3aa72a600d5b3ebb92f2c~TA1TCcMzD1993019930eucas1p2j; Tue, 22 Dec 2020 10:32:34 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201222103234eusmtrp2ea23b627de8f1bcec973529875015f86~TA1TB1qkd1881618816eusmtrp2W; Tue, 22 Dec 2020 10:32:34 +0000 (GMT) X-AuditID: cbfec7f4-b4fff7000000af05-a9-5fe1cb422dd2 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id C2.EB.21957.24BC1EF5; Tue, 22 Dec 2020 10:32:34 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201222103234eusmtip209e8325ecf6f8a16858a8de927922a94~TA1SrDZZa3133931339eusmtip2K; Tue, 22 Dec 2020 10:32:34 +0000 (GMT) From: Marek Szyprowski <m.szyprowski@samsung.com> To: u-boot@lists.denx.de Cc: Marek Szyprowski <m.szyprowski@samsung.com>, Lukasz Majewski <lukma@denx.de>, Marek Vasut <marex@denx.de>, Jaehoon Chung <jh80.chung@samsung.com>, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Subject: [PATCH v2 1/5] dfu: mmc: use the default MMC device if entity specifies it as -1 Date: Tue, 22 Dec 2020 11:32:20 +0100 Message-Id: <20201222103224.9018-2-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201222103224.9018-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsWy7djP87pOpx/GG8w4amSxccZ6Vosbv9pY LZ6/u8xksfbIXXaLN22NjBZv93ayO7B5zJt1gsXj7J0djB59W1YxBjBHcdmkpOZklqUW6dsl cGVcvf+UrWAGT8Wzu19ZGhg/cHYxcnJICJhIXOrZzNTFyMUhJLCCUeLh4h5mCOcLo8S25XPY IJzPjBJ/z/UxwrScPjQTqmU5o8SDZV2scC0vlt5jAaliEzCU6HrbxQZiiwhISPzqvwrWzSxw kVHi939jEFtYIFpi5ecjYPUsAqoS+7c/YwWxeQVsJG7fPAm1TV5i9YYDzCA2p4CtxJKlL6Hi nRwSOxeUQtguEvufL2ODsIUlXh3fwg5hy0j83zkf7FIJgWag586tZYdwehglLjfNgJpkLXHn 3C+gbg6g6zQl1u/Shwg7SrQeng0WlhDgk7jxVhDifj6JSdumM0OEeSU62oQgqtUkZh1fB7f2 4IVLzBC2h8TciasYIeEzgVHi0rx77BMY5WchLFvAyLiKUTy1tDg3PbXYKC+1XK84Mbe4NC9d Lzk/dxMjMBWc/nf8yw7G5a8+6h1iZOJgPMQowcGsJMJrJnU/Xog3JbGyKrUoP76oNCe1+BCj NAeLkjhv0pY18UIC6YklqdmpqQWpRTBZJg5OqQamRUbTQrxu2Wn6iCU8bPMsVXR9Fjnr4on8 Sl3XgOATXM3Lt0269SzzhtmyZRzfT8lFVHJpFenEFLYe/DGfpyLI36fRMCXsXWz41/mqzd/M NXOURN77Wbec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p/Twc6QnVwMFp4OnIeadjjxe/JY+MyzDdgQfGOme+xCu7VnGovLVDuSNtUGRbP+ufi5bM43 hS2buZ478TxorU+ctpJTaK+awZHzs0VlP3zuZLOesFLTuW3CPcsPfx5sfBVSe/0FN+vOeUnv twRLlyuxFGckGmoxFxUnAgBqliqK1gIAAA== X-CMS-MailID: 20201222103234eucas1p208db1186f9c3aa72a600d5b3ebb92f2c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20201222103234eucas1p208db1186f9c3aa72a600d5b3ebb92f2c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201222103234eucas1p208db1186f9c3aa72a600d5b3ebb92f2c References: <20201222103224.9018-1-m.szyprowski@samsung.com> <CGME20201222103234eucas1p208db1186f9c3aa72a600d5b3ebb92f2c@eucas1p2.samsung.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean |
Series |
DFU: new entity types and minor improvements
|
expand
|
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c index 691d01c7eb..784d0ec76b 100644 --- a/drivers/dfu/dfu_mmc.c +++ b/drivers/dfu/dfu_mmc.c @@ -316,7 +316,7 @@ void dfu_free_entity_mmc(struct dfu_entity *dfu) int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s) { const char *entity_type; - size_t second_arg; + ssize_t second_arg; size_t third_arg; struct mmc *mmc; @@ -339,7 +339,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s) * Base 0 means we'll accept (prefixed with 0x or 0) base 16, 8, * with default 10. */ - second_arg = simple_strtoul(argv[1], NULL, 0); + second_arg = simple_strtol(argv[1], NULL, 0); third_arg = simple_strtoul(argv[2], NULL, 0); mmc = find_mmc_device(dfu->data.mmc.dev_num); @@ -406,7 +406,8 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s) /* if it's NOT a raw write */ if (strcmp(entity_type, "raw")) { - dfu->data.mmc.dev = second_arg; + dfu->data.mmc.dev = (second_arg != -1) ? second_arg : + dfu->data.mmc.dev_num; dfu->data.mmc.part = third_arg; }
Use the default MMC device set in the command line if entity specifies it as -1. This allows to use the same dfu_alt_info string for different MMC devices (like embedded eMMC and external SD card if data layout is the same on both devices). Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> --- drivers/dfu/dfu_mmc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.17.1