From patchwork Tue Sep 29 22:18:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 285747 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 71B05C4727D for ; Tue, 29 Sep 2020 22:22:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22EAC207F7 for ; Tue, 29 Sep 2020 22:22:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IaVQKeEk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729138AbgI2WU5 (ORCPT ); Tue, 29 Sep 2020 18:20:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729032AbgI2WUt (ORCPT ); Tue, 29 Sep 2020 18:20:49 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CFCCC0613D1; Tue, 29 Sep 2020 15:20:48 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id r24so5361917ljm.3; Tue, 29 Sep 2020 15:20:48 -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=VcUXWgT8fmiQGlBR0JIfsCe8ypmBEn8DqgdCSfZJyN4=; b=IaVQKeEkzXKog/PEJXJ1mgImzUItixmSZDrWfixxI2/duGYO3pxI/j9InOYrtWGjLL CsierVNmIFC7uVzYIMwK8duQJrdwSoBrtGDF8ur3w6jc2S50sCkODWfGvA62shBuMHiV /1IjVNLgtnPcQOhD1Ph9rfF9Gv4GTt/gm3iCBP7V0GxZjUQGbOGOxcZcGOmiqgQxw18J VwdP2RpSvf+wyzOhEWyg+0QnXsYF2HKqIrh4CvbseRXEvEXbyhubUUXDDXXZUB2mo6IC EphOCXNz7bsTe4c+oz4mE1DVmfbaIE+FZ7iE4CvQuJyThgZQFHER+LM5/ojjgaIGtCln dthA== 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=VcUXWgT8fmiQGlBR0JIfsCe8ypmBEn8DqgdCSfZJyN4=; b=W2WzbjJ7KWPggSq5LuUc3vYEYFaQNkb1Zpmt74iOD8tQOA35FReoEqgHcyj+YeRUnG HGz9mphTXxP1Vn+PJbXwQrGBPuA4wl/hiQ6XnfBh82Y1FEshz2z773kdmyDuJf1Y72kP 2LMFbw1WbsLWaA8SUs7UOeaZ5lXmXUl2Rn77yKmrY2yGdhEXg3M4KBfQfhENezTNJS9r jdhCmTJNGGd5f0UKGvRi+7MbX5lyWbzK1iZRQgRs3KsBUXhGz1FuTu93cbzQUcf9136K WIDCKmxL3CXI+3PPqyWllT9KdwYG/EAwOrqTNHoh+oyuSdM4pz9Jdvb1WhwCV4po8czL KDNg== X-Gm-Message-State: AOAM530zzAbVFMu3HmeFPGXPHYC+IQ6EWfeODpbXzSudhft5IVUwqKN9 qVQqouOSss9RSZLdfixGNeI= X-Google-Smtp-Source: ABdhPJwUJDSsVwgmTMjwx2u++rkboQ+MZLUOeoq++XoTWXLMHxDPHVI3CysAFVr6vPUeidVyEvaPyA== X-Received: by 2002:a2e:9ad3:: with SMTP id p19mr1709947ljj.374.1601418047063; Tue, 29 Sep 2020 15:20:47 -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 q18sm3379750lfr.138.2020.09.29.15.20.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 15:20:46 -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 v9 11/32] i2c: tegra: Use platform_get_irq() Date: Wed, 30 Sep 2020 01:18:54 +0300 Message-Id: <20200929221915.10979-12-digetx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200929221915.10979-1-digetx@gmail.com> References: <20200929221915.10979-1-digetx@gmail.com> MIME-Version: 1.0 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 Reviewed-by: Andy Shevchenko Acked-by: Thierry Reding Tested-by: Thierry Reding Signed-off-by: Dmitry Osipenko --- 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)) {