From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CF51C433FE for ; Mon, 27 Sep 2021 22:03:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4886E6101A for ; Mon, 27 Sep 2021 22:03:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237911AbhI0WFg (ORCPT ); Mon, 27 Sep 2021 18:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237645AbhI0WFP (ORCPT ); Mon, 27 Sep 2021 18:05:15 -0400 Received: from bombadil.infradead.org (unknown [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E068C061213; Mon, 27 Sep 2021 15:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=adUhWGLmSwGDCmYJPL/wycZ+ESyOItTDyVeSKbBPSXk=; b=ln976+r6AHlYQ6p0Ges6IER5s8 MPl+7sPxPkyG/OoMQrAYGw6eVCfo5DobXvpsiPoemFpVVNidY/EqvDeDj/iHJb5AK+QV/PSPHJzxZ MEu+/8Il3ODNCCTJvIgEHJmeacHxxtaAyiflR5+Vjqj8psNnJTU3E6HKG3F6NPayQ/pSSJeOLuOJr G4X/6iQsum1AaLkf/nyM6LeexkyV5PS+3OnZ/VK7gHgNMrlJZPFi/datb1qHLzKBzf3Xzmmm09i20 lrvu+SxRLhM6QUVWIp6ioD95iJoNaVp1NdaD1ge2VazFolL2mBBTD3RERg8rEHH8rfvOpc0Mw5aJQ 3kQmY/9w==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUyhC-004UJE-Bd; Mon, 27 Sep 2021 22:01:58 +0000 From: Luis Chamberlain To: axboe@kernel.dk, bhelgaas@google.com, liushixin2@huawei.com, thunder.leizhen@huawei.com, lee.jones@linaro.org, geoff@infradead.org, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, jim@jtan.com, haris.iqbal@ionos.com, jinpu.wang@ionos.com, josh.h.morris@us.ibm.com, pjk1939@linux.ibm.com, tim@cyberelk.net, richard@nod.at, miquel.raynal@bootlin.com, vigneshr@ti.com Cc: linux-mtd@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH v2 01/10] mtip32xx: add error handling support for add_disk() Date: Mon, 27 Sep 2021 15:01:48 -0700 Message-Id: <20210927220157.1069658-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210927220157.1069658-1-mcgrof@kernel.org> References: <20210927220157.1069658-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling. The read_capacity_error error label already does what we need, so just re-use that. Signed-off-by: Luis Chamberlain --- drivers/block/mtip32xx/mtip32xx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 901855717cb5..d0b40309f47e 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -3633,7 +3633,9 @@ static int mtip_block_initialize(struct driver_data *dd) set_capacity(dd->disk, capacity); /* Enable the block device and add it to /dev */ - device_add_disk(&dd->pdev->dev, dd->disk, mtip_disk_attr_groups); + rv = device_add_disk(&dd->pdev->dev, dd->disk, mtip_disk_attr_groups); + if (rv) + goto read_capacity_error; if (dd->mtip_svc_handler) { set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag); -- 2.30.2