From patchwork Mon Jun 20 15:43:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 583518 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB150C43334 for ; Mon, 20 Jun 2022 15:44:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237139AbiFTPoB (ORCPT ); Mon, 20 Jun 2022 11:44:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244224AbiFTPn5 (ORCPT ); Mon, 20 Jun 2022 11:43:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CD061AD8F for ; Mon, 20 Jun 2022 08:43:56 -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 ams.source.kernel.org (Postfix) with ESMTPS id 51AF3B811C7 for ; Mon, 20 Jun 2022 15:43:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A2E5C3411B; Mon, 20 Jun 2022 15:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655739833; bh=FRsip9+0icriLz8iFAwx+5Xu+yMJNijStZ3Xui+swUg=; h=From:To:Cc:Subject:Date:From; b=J8hdYrXJXaMAraP3Ke+ZPz7Yp9lfihvSY/PBGrZ+OXhYbtEh4akhFUDwsWfl87Q/E YkqvIdHxOJ6c6QMRfXO72S2+NkqravikbY6w+e6mIxjMG1EZ8DqsRV2iwEkp+VxH8q glqSKOpYPkc+XNn5zOsE5Q1+V/nWJuuj0E1c3Naj683ChPAx8opvjIst+9RVIy+mr0 4mjqxgKrLhyK1diBXFIDqTsKdBiQQJWBp2MzN6T+8Zvm+RMKsO7chxHMdH3eJDoAf3 aTphELwe62mK6fPRsH01MWKf/f/+bz4HWgauJmc9s9JwB1/YlQ6FhHGc3P5N0cHP1X HGP+b2iZakZVA== From: matthias.bgg@kernel.org To: dan.carpenter@oracle.com, johnson.wang@mediatek.com Cc: linux-pm@vger.kernel.org, linux-mediatek@lists.infradead.org, angelogioacchino.delregno@collabora.com, Matthias Brugger Subject: [PATCH] PM / devfreq: mediatek: Fix unnecessary check of drvdata Date: Mon, 20 Jun 2022 17:43:47 +0200 Message-Id: <20220620154347.14756-1-matthias.bgg@kernel.org> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Matthias Brugger Probe function will error out if drvdata 'mtk_ccifreq_drv' is null. So when mtk_ccifreq_target get's called, the drv pointer will never be NULL. This fixes a static checker warning. Cc: Dan Carpenter Signed-off-by: Matthias Brugger Reviewed-by: AngeloGioacchino Del Regno Tested-by: Johnson Wang --- drivers/devfreq/mtk-cci-devfreq.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/devfreq/mtk-cci-devfreq.c b/drivers/devfreq/mtk-cci-devfreq.c index 71abb3fbd042..ad05b152071d 100644 --- a/drivers/devfreq/mtk-cci-devfreq.c +++ b/drivers/devfreq/mtk-cci-devfreq.c @@ -132,9 +132,6 @@ static int mtk_ccifreq_target(struct device *dev, unsigned long *freq, unsigned long opp_rate; int voltage, pre_voltage, inter_voltage, target_voltage, ret; - if (!drv) - return -EINVAL; - if (drv->pre_freq == *freq) return 0;