Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1573966pxb; Fri, 20 Aug 2021 08:39:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4P6Pl6GRZyxcSIkz7e1dCll7/utcMHFUErcie3rK6v47WKIxWKWtdGm3LhZAOB8caPyvG X-Received: by 2002:a17:906:3809:: with SMTP id v9mr22407318ejc.355.1629473991848; Fri, 20 Aug 2021 08:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629473991; cv=none; d=google.com; s=arc-20160816; b=EvGlYfwFCealv74oHdogyzN7iMYgPv7cDOLiT542dwQoFQzPlNSBw/zN9hSHq6Bh7w vpZVpW8FjlmOxwo63SaZBwIYsO5Idstk4v31G+PDnZvVaojhE8G5Is7MgvKaRfVPIyNL LT9VmZXOD5YUk9D2NbbqyO+xY5daGardXe3G6dh8q1hdyfC1tj3nG+Jd3dDd96QJ1G4I mKmtKC5VgpvET8UzGFMcuobbNQ5b1SDzmzPG/giu+Ozg7tycKSD7gRVYIrGcmcOBbkD+ F95npaIOuy8kBbpXxFcyqTzsXuGOQXykAylz7pN5JS2nByr7xJ+fdrTtAOG60KNS7PGA MA5A== 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; bh=TvFXrpz7J1JZdaprsIP+3G1WMvikHOXEpBX/lXbCKr0=; b=S/ZTycWcdryG7dQqjrdNYZH0925HEvFAS3C0ihuA8ruyK0Ah27Bn8y6sl7HqIBUYBJ rGrzLser4Ltplk6c6igPwXzcMQC+mroIN0L7bR5KPr9hjs5er3QUhJqxOoX3XulYrOle BNgVDlifuLKCwH4+NRgReqw9qT8k+NeC2m3GZEV8e50up/zpbmtiEmGhM4S+qCVrh+lx nia3ZLk4qfwRyLl8wu2iieQQo0hrgUh9r33a7Hcn9wS5KIwe6KlkOHW3DBxchYurWx+8 evSzh/j2xcWZYbUOCO12u9At/IJCqlk/AI7K0oCHDJZ+uxoi0GqbT57wkK9Oxas4Hqwx tlAA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd5si3477456ejc.375.2021.08.20.08.39.27; Fri, 20 Aug 2021 08:39:51 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240952AbhHTPi2 (ORCPT + 99 others); Fri, 20 Aug 2021 11:38:28 -0400 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:46724 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241038AbhHTPi1 (ORCPT ); Fri, 20 Aug 2021 11:38:27 -0400 Received: from pop-os.home ([90.126.253.178]) by mwinf5d04 with ME id jrdm2500h3riaq203rdmyj; Fri, 20 Aug 2021 17:37:48 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 20 Aug 2021 17:37:48 +0200 X-ME-IP: 90.126.253.178 From: Christophe JAILLET To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, alexandru.marginean@nxp.com, Laurentiu.Tudor@nxp.com, hui.song_1@nxp.com, andy.shevchenko@gmail.com, ran.wang_1@nxp.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 0/3] gpio: mpc8xxx: Fix 3 errors related to the error handling path of the 'mpc8xxx_probe()' Date: Fri, 20 Aug 2021 17:37:44 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This has been split in 3 patches because: - the root issue of patch 1 and 3 is not the same commit as the one for patch 2. - the strategy to fix the issues is not the same - patch 1: add a new call in the rror handling path - patch 3: switch to a resource managed function They could be merged together if easier to review. The subject would then be something like "gpio: mpc8xxx: Fix the error handling path of 'mpc8xxx_probe()'" If prefered, 'devm_add_action_or_reset()' could be used to switch the probe to a fully managed resource function and remove the 'remove' function. That's mostly a matter of taste. If such an option is preferred, I'm a bit puzzled by the 'irq_set_chained_handler_and_data()' call in the remove function because I don't see why it is there. Also see the comment at the end of patch 1 also related to this function call. Christophe JAILLET (3): gpio: mpc8xxx: Fix a resources leak in the error handling path of 'mpc8xxx_probe()' gpio: mpc8xxx: Fix a potential double iounmap call in 'mpc8xxx_probe()' gpio: mpc8xxx: Use 'devm_gpiochip_add_data()' to simplify the code and avoid a leak drivers/gpio/gpio-mpc8xxx.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.30.2