Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3123951rwb; Mon, 15 Aug 2022 18:43:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR5+LiWXD34pq8wG9wO2PSCrONPEP8Od7h+OyFxUwVc/diU8RAUAbWFnQvMo82trNydmHMZv X-Received: by 2002:a63:d70b:0:b0:415:f5f1:dd19 with SMTP id d11-20020a63d70b000000b00415f5f1dd19mr16184721pgg.273.1660614199176; Mon, 15 Aug 2022 18:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660614199; cv=none; d=google.com; s=arc-20160816; b=D4dhOaJCXv/vPIrgsfA+XpX/8L2TveONfxozeQB6DCLILBq/2C5Q4XpnC4v3KxYbWa n6xj5LPaOL0PUAkQL53pPVXw4djDrs+SGcWkKglNHRyUUUDY9k0mCXoszpI2vruKl8ll Zit/Xudcw2IPbN0zpAdyeTHgDhGGvdudqrKW21OyqvclDwyqzUKvWj5g5hJdldaLRw4v B1fRsL7lZ/hDGexE3jdBM0rciiaeql80YyH+QLBu0kY5oYHTRfDpqXy9zdAMb/b1SFlt 1Yvl67j0ZWmPqJ5fQpC+DPOGuZKLYUhVyXZ0aXrOp6cc96L0qiF/vKQwtUIRYYUgKHVY NfLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=S5O+3O+UBgqpOda+svmuXqNNnpF5HtU81e51zWG0nQ4=; b=yeXPqpLBMDHbaNo3qIb+gJjhA4qaV/VleyWPC+pk+Guf3Ul8Zc9jK4fkNw8GnhKk17 cwzd1TgNWmfTywFOOlP6RMUSu6lauy8m8USvX8KvO9fgIUdaJIz7XzH35YGV+RMwuldz p8u/R+OgUz0q3uIrh9TwYVf2WzcuXsphehKz83QVKLY+uOlCwCUh7Y10KwKnR2FrY8LU eggdhxDgXTjI/Chfq1FpnTC278TaGvDBgp8HeouLrQyBf/xgwu0vGXB+9igh3Gj163KY N6Vf2v4Ftm7ywdISQEzKAYTOqjTRQ9EuAk1YMZGZn4RuHToQvwQr0ltLos3fH9C+kMa7 7lRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="h3/hspFh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 137-20020a62198f000000b005251a325ea0si7463568pfz.269.2022.08.15.18.43.08; Mon, 15 Aug 2022 18:43:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="h3/hspFh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355938AbiHPAGp (ORCPT + 99 others); Mon, 15 Aug 2022 20:06:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353774AbiHOX6u (ORCPT ); Mon, 15 Aug 2022 19:58:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93C1410B4; Mon, 15 Aug 2022 13:22:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F1F861073; Mon, 15 Aug 2022 20:22:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33931C433C1; Mon, 15 Aug 2022 20:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594927; bh=CXsiMlpxl/lPeiBhHDsWcyx72OmLP0Buq3FF1+bOVWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h3/hspFhrFmQ0BMlPcpjNeeqCpdxxlohtNpO1nl3N+ywrznB1aYqMAdJ+tQdCUMCq 8SneZ7q8YjT9r+CCy8+Ggsmrvrrml8eijTvSoSjZlKeK59NFHjrTd2w+kC7gT4UL0t P21SYJC+VvFKuAFuub0N1epPuE/NBvG4KMNekWGY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Miquel Raynal , Sasha Levin Subject: [PATCH 5.19 0602/1157] mtd: spear_smi: Drop if with an always false condition Date: Mon, 15 Aug 2022 19:59:18 +0200 Message-Id: <20220815180503.745446258@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Uwe Kleine-König [ Upstream commit 279d719be39d8edb37c9178c15e167a94c7bc0a0 ] The remove callback is only called after probe completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so dev is never NULL. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220603210758.148493-8-u.kleine-koenig@pengutronix.de Signed-off-by: Sasha Levin --- drivers/mtd/devices/spear_smi.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c index f6febe6662db..f58742486d3d 100644 --- a/drivers/mtd/devices/spear_smi.c +++ b/drivers/mtd/devices/spear_smi.c @@ -1048,10 +1048,6 @@ static int spear_smi_remove(struct platform_device *pdev) int i; dev = platform_get_drvdata(pdev); - if (!dev) { - dev_err(&pdev->dev, "dev is null\n"); - return -ENODEV; - } /* clean up for all nor flash */ for (i = 0; i < dev->num_flashes; i++) { -- 2.35.1