From patchwork Tue Sep 8 22:39:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 254750 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D146C2BC11 for ; Tue, 8 Sep 2020 22:45:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F31E6207DE for ; Tue, 8 Sep 2020 22:45:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="q49T129r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729942AbgIHWoa (ORCPT ); Tue, 8 Sep 2020 18:44:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729789AbgIHWkf (ORCPT ); Tue, 8 Sep 2020 18:40:35 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4565C061755; Tue, 8 Sep 2020 15:40:34 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id z19so539370lfr.4; Tue, 08 Sep 2020 15:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hUUPRBULDiyvblMhx4V1F89haxR9rFzQ0ynZsEU3uxo=; b=q49T129r199DY86luMHEEwZ9WtFc3zQtkHwjuP6f9NlMeFtqaaUcMVaCn4BWdIOOUq +8+FJj7DNngx83sxHkfXuPrtkdg+2z197Moi4Tltxq25j+cFQMOQF3Fspgeo1ZbMuOMw x7Lcp20TOkzKNPOrnIjmoI104ybs3Xt2PnK4XBs6/6E9Da/uppoozgyh4jlD4VPvvlAx cQbuAYmqvQalv3hZ5S8Oc4oQsX0dfXUueHOkDhU+GfF2TfR+JTInu4yT7jgQtHncNs+m nJ44njw89Vs0srK71N6lvp8SPkxPrheoTG0c0bB+/nWfl2wMdHg1wA3qwGqkkq/g5uSY j7Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hUUPRBULDiyvblMhx4V1F89haxR9rFzQ0ynZsEU3uxo=; b=mLMgqrs81p4kY8BScscPsxZ//urZofKmdgybd9knzj7b3OP4A8luzVx4bs2UMBn0BJ IChSaZwXZcNjKrienNPEai/u3jsIKJcm+0hwE/g2omLJVHkWiTbf6Pcbvh4F5IrtZWsS nNHSGTlgoJk4fIMQAOPkkqUt6M3Qku9fl8OyjM4yW/8IuoUV9hVDjqPaaOgSdYm4f4PD kMLnhyE3a3yffId30HiM7OmNHVWk+kSP8EE00wWHL4gzHnT1DkJ9vm2JLREeuGkQo/tK vIJP8KbqZvbJ3T3FXJtOi3iO/28DWRmfcH95XRjKtfjzXyUOqX49wfoB+/2dye3Mfecd Uc1w== X-Gm-Message-State: AOAM532KcsYRIIJYoQW9pL4apkAdpoV7jgVceS+CDxZETIA+za5a/6f2 fs/+5Eh6DhSWlC6MOrC12rA= X-Google-Smtp-Source: ABdhPJz36wiwn0eDZa3Bo/dxiocNuoVT7nH0pYUDdmf/IKYoSD8ReB5v8KaOc9emkFVtqsvvr0X8lg== X-Received: by 2002:a05:6512:70f:: with SMTP id b15mr537966lfs.39.1599604833326; Tue, 08 Sep 2020 15:40:33 -0700 (PDT) Received: from localhost.localdomain (109-252-170-211.dynamic.spd-mgts.ru. [109.252.170.211]) by smtp.gmail.com with ESMTPSA id s15sm268311ljp.25.2020.09.08.15.40.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 15:40:32 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Laxman Dewangan , Wolfram Sang , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= , Andy Shevchenko Cc: linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 11/34] i2c: tegra: Use platform_get_irq() Date: Wed, 9 Sep 2020 01:39:43 +0300 Message-Id: <20200908224006.25636-12-digetx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200908224006.25636-1-digetx@gmail.com> References: <20200908224006.25636-1-digetx@gmail.com> MIME-Version: 1.0 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Use common helper for retrieval of the interrupt number in order to make code cleaner. Note that platform_get_irq() prints error message by itself. Reviewed-by: Michał Mirosław Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Tested-by: Thierry Reding --- drivers/i2c/busses/i2c-tegra.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index c2bbdf92b11f..505b5d37077d 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -1684,12 +1684,9 @@ static int tegra_i2c_probe(struct platform_device *pdev) base_phys = res->start; - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!res) { - dev_err(&pdev->dev, "no irq resource\n"); - return -EINVAL; - } - irq = res->start; + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; div_clk = devm_clk_get(&pdev->dev, "div-clk"); if (IS_ERR(div_clk)) {