Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4110487pxb; Sat, 13 Feb 2021 22:50:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYohppSZ6O2lZrYZ7X9E6P68tnpbYWn+WzeNvSk6Dhi3WW6sSxodzcysMxItInw3o08H5u X-Received: by 2002:a05:6402:1383:: with SMTP id b3mr10074124edv.131.1613285435862; Sat, 13 Feb 2021 22:50:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613285435; cv=none; d=google.com; s=arc-20160816; b=BUURtAMCCAlm4cpAtDDMxHXdu/3yOLRPdgPlNMn0uvXXoFn2r4si/+J3nxl91Yy2kz 5LneyS7mWYW/vt857ZFj4YQt0BAEh0I3bRsc4tzVuNUiRQUzm1OWu6qVbbHqsPuTkrJg 9POfAt/Jnd3bGQbiVD2cBi2USSTu0C3HwxCYVHaCNXCHwTv/bAOqcPQczEofxqLV8tYV DzexJK9CydQkAYmf/IvBqh1n4ZR7NUvUMEyyeZY91AsrU+SbnXl9LP7kiZeybc/TsQx/ tMY2bBye9QD9/j/g91Cw/vRYhrzzWsYpokYTj0clVAHNYIGuN/C9OZiNxIDApOW4sk3T kYeQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Kxieg2fYbmNp08HkGfhgbIDiBi4p+VeYpKohIERpFA8=; b=feJh/1beJ+LTM6MFV/IHhaKqXclMQdD2by07F2PKHxElGR7fK85M9cUnLsAUqrLRBz 4McueD9y3TM6C73KYGLp3qsINORXN0OWy5V+y9n5+Ksbe01a6Wa2/j+YTBiNZL7wPNhy IG0rPe+vvubmP+CSNfJc2/4oLScQ51hXgGylo4ShDlgVEVLaV5cbn8ClxjWZqTNcmHw5 zhZuhsr5Xx5G9zjsd0PUnBU5NzBa5sTgVfxqtIgl7jB54q/ddFMxKON6rjAtkm8KHpRI 1N0oGn7fN1/ZU0q4YJPVbQ61HruojRSd2g+fj4oywWNPYQNtcHT0DdyeI2qhVaR00qAh ynxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cK5/G+LR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v14si9892845ejx.593.2021.02.13.22.50.13; Sat, 13 Feb 2021 22:50:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="cK5/G+LR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229869AbhBNGqS (ORCPT + 99 others); Sun, 14 Feb 2021 01:46:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbhBNGqP (ORCPT ); Sun, 14 Feb 2021 01:46:15 -0500 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83ED3C061574; Sat, 13 Feb 2021 22:45:35 -0800 (PST) Received: by mail-pg1-x52a.google.com with SMTP id m2so2408978pgq.5; Sat, 13 Feb 2021 22:45:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Kxieg2fYbmNp08HkGfhgbIDiBi4p+VeYpKohIERpFA8=; b=cK5/G+LROFF73yYorWUTE9ddeKSLK1MjoIvVAuAuaBOZfnEDGu4aJcUFFY3rkzTQb/ qxES8JqFUjhEhH1n65QjaMBh5GUnLEztMLVwD6ITj3F0CbUfMKHRyvruMUZFiJVleq+C GFJrcokvWrlqgg0gM1MTh+KNe2glT8eNzhMS3wfpDBFfBC4VyZces0RtKQhzi+yHh4Aj BrJ9muaLabfKRpOhbJiL1MsBPh6oMJUuafST/sZw4nTHpuNnbBGet4o/iJ1eUN5v5jbZ KCv4VKpDesOLs6U75jse3fYp9yOKwBD8njcvOF33KHDw9QvyrWPEvTyzqy9lcFnStmtQ N7SA== 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:mime-version :content-transfer-encoding; bh=Kxieg2fYbmNp08HkGfhgbIDiBi4p+VeYpKohIERpFA8=; b=D4bMUS52n8XxGc3UktAnFsSQna1L9vS/zoFksMydlXYEPB4A57Y9bpNb6L5HzRb8cI j7Jxez5ATyM8x9rEVr6gz+xq+9ULDnUDkjDPwLqDiAiZb/wrXnEs7zGntvCpVeFHrofo Rg2VZUlJtB3JaTeqLuz/pE/06V0xXcPICNTXDDi3/dFoY60E4BIOzYMH7E4JpKF3BcgZ UOu3u1MJbk7mQdb0Vx4za1b9dBGpSd7iay+2YUxug4pOCZxZfZ4MjfCk4MDN/+/aMWsD HSM3pfgdnJg4A0Wk4gxfBZDbSwt9oIeBq/gNZnEukBb/DTl/lnBFpQ1xvzxJvruKd9Y0 8aeg== X-Gm-Message-State: AOAM532Bfo8NvyUYCXKhJa+/Yota2Mn90xX3tgMPmITf5KGr5L7v6Vgq Ls8aIoqFfYZk5F3VsJ6Pqe4= X-Received: by 2002:a65:6706:: with SMTP id u6mr10378754pgf.26.1613285134998; Sat, 13 Feb 2021 22:45:34 -0800 (PST) Received: from localhost (185.212.56.4.16clouds.com. [185.212.56.4]) by smtp.gmail.com with ESMTPSA id o11sm11736110pjo.43.2021.02.13.22.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Feb 2021 22:45:34 -0800 (PST) From: Dejin Zheng To: jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, wsa@kernel.org, linux-i2c@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Dejin Zheng Subject: [PATCH i2c-next] i2c: designware: Consolidate pci_free_irq_vectors to a single place Date: Sun, 14 Feb 2021 14:45:29 +0800 Message-Id: <20210214064529.481341-1-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Consolidate pci_free_irq_vectors to a single place using "goto free_irq" for simplify the code. Signed-off-by: Dejin Zheng --- drivers/i2c/busses/i2c-designware-pcidrv.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 55c83a7a24f3..f0c82e91870a 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -234,10 +234,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, if (controller->setup) { r = controller->setup(pdev, controller); - if (r) { - pci_free_irq_vectors(pdev); - return r; - } + if (r) + goto free_irq; } i2c_dw_adjust_bus_speed(dev); @@ -246,10 +244,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, i2c_dw_acpi_configure(&pdev->dev); r = i2c_dw_validate_speed(dev); - if (r) { - pci_free_irq_vectors(pdev); - return r; - } + if (r) + goto free_irq; i2c_dw_configure(dev); @@ -269,10 +265,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, adap->nr = controller->bus_num; r = i2c_dw_probe(dev); - if (r) { - pci_free_irq_vectors(pdev); - return r; - } + if (r) + goto free_irq; pm_runtime_set_autosuspend_delay(&pdev->dev, 1000); pm_runtime_use_autosuspend(&pdev->dev); @@ -280,6 +274,10 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, pm_runtime_allow(&pdev->dev); return 0; + +free_irq: + pci_free_irq_vectors(pdev); + return r; } static void i2c_dw_pci_remove(struct pci_dev *pdev) -- 2.25.0