From patchwork Mon Jun 13 05:30:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 634362 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3rShcx5cmlz9t0Y for ; Mon, 13 Jun 2016 15:47:29 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=d3gdw8ef; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 67518A7535; Mon, 13 Jun 2016 07:47:27 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gwJHd9cVzJBu; Mon, 13 Jun 2016 07:47:27 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E6250A74D6; Mon, 13 Jun 2016 07:47:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8564BA74D6 for ; Mon, 13 Jun 2016 07:47:23 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lh1K0-PJM9yj for ; Mon, 13 Jun 2016 07:47:23 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) by theia.denx.de (Postfix) with ESMTPS id 190C4A74D2 for ; Mon, 13 Jun 2016 07:47:19 +0200 (CEST) Received: by mail-it0-f46.google.com with SMTP id i6so9227713ith.0 for ; Sun, 12 Jun 2016 22:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=nkFzMjtFCI7TJBXZpqQaHAy7uw9SyvQW16AoY1kzpY4=; b=d3gdw8ef2dqrRFA+frO+8GE/pwiuKncd8gM09q30uIc0UcwrFURHdhm8I9e0QB6BzX eEqogGt64eV06uM4G/Y2fGaDSsiSppbHJ1wyKXHdGCuBJJs0N7rn60zj9RSsHtoUgmu9 5XBczQ/IegcaAeNTxhUl86plFZdx7mhZHgWgs4sfC2I2APzgiEzEu9hu5/hpwr7NSgsS bB8rwfBtHYH5HRjbxS+GYOB27B9rBOnds15ny9AsNogDmxBjzs7V/oiuNH9mnUMzdJ6x fNtKF6r6R/MPRLF2SsozF/j4vnS9/+8bX9SzkRy1g5HC1OLlD0oCY7/TxiH+ztraSUeJ Gl9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=nkFzMjtFCI7TJBXZpqQaHAy7uw9SyvQW16AoY1kzpY4=; b=jATV6qTpaqcY3oSeNKHay/tMs4hDtEw8n2AziscPkXT5YoX667o/tR1XiLdYFr76rH f6EEQJV3hw/Y8sStP1otaxCs45PlX36pgWX4KkCMbTW9FFEG3LawEqdqCnGKk96JGuL1 kz49LGQpczg64nQrmzz82xjlkW3s0JwvN+gZVVHotS/7akfzePyOH34P5u+0FOuXpgs/ PtbHykwwe+CirOwqUzrBHrjRs3s8lFKBMZqbYlrE6E4nisa0Z5JfS56cqUKbQ0gL1AL5 KIUHkYHtwjDneKacZeXbtgDHmbHRvjwXrLxQtO8/CGb7bIv9xduDSBHeQsVJ0dMDOjmN vdzg== X-Gm-Message-State: ALyK8tJ3wQFYkbrp2ruBeDdiumCAF3UU2UdVt9YdB9hObb3yVNSpK/beD4uqxv75NajdWorx X-Received: by 10.36.54.85 with SMTP id l82mr15709888itl.18.1465796838255; Sun, 12 Jun 2016 22:47:18 -0700 (PDT) Received: from kaki.bld.corp.google.com ([100.100.202.57]) by smtp.gmail.com with ESMTPSA id c130sm2196020ioe.42.2016.06.12.22.47.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jun 2016 22:47:17 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id CCD25222A1F; Sun, 12 Jun 2016 23:30:57 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 12 Jun 2016 23:30:33 -0600 Message-Id: <1465795839-16632-22-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1465795839-16632-1-git-send-email-sjg@chromium.org> References: <1465795839-16632-1-git-send-email-sjg@chromium.org> Cc: Pantelis Antoniou Subject: [U-Boot] [PATCH 21/27] dm: dfu: mmc: Support CONFIG_BLK in DFU for MMC X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Update the method of accessing the block device so that it works with CONFIG_BLK enabled. Signed-off-by: Simon Glass --- drivers/dfu/dfu_mmc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c index 78724e4..926ccbd 100644 --- a/drivers/dfu/dfu_mmc.c +++ b/drivers/dfu/dfu_mmc.c @@ -49,7 +49,7 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu, } if (dfu->data.mmc.hw_partition >= 0) { - part_num_bkp = mmc->block_dev.hwpart; + part_num_bkp = mmc_get_blk_desc(mmc)->hwpart; ret = blk_select_hwpart_devnum(IF_TYPE_MMC, dfu->data.mmc.dev_num, dfu->data.mmc.hw_partition); @@ -62,12 +62,11 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu, dfu->data.mmc.dev_num, blk_start, blk_count, buf); switch (op) { case DFU_OP_READ: - n = mmc->block_dev.block_read(&mmc->block_dev, blk_start, - blk_count, buf); + n = blk_dread(mmc_get_blk_desc(mmc), blk_start, blk_count, buf); break; case DFU_OP_WRITE: - n = mmc->block_dev.block_write(&mmc->block_dev, blk_start, - blk_count, buf); + n = blk_dwrite(mmc_get_blk_desc(mmc), blk_start, blk_count, + buf); break; default: error("Operation not supported\n"); @@ -356,7 +355,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s) } else if (!strcmp(entity_type, "part")) { disk_partition_t partinfo; - struct blk_desc *blk_dev = &mmc->block_dev; + struct blk_desc *blk_dev = mmc_get_blk_desc(mmc); int mmcdev = second_arg; int mmcpart = third_arg;