From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 5D843C33CAF for ; Thu, 16 Jan 2020 23:34:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2769F20661 for ; Thu, 16 Jan 2020 23:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217640; bh=Bytc26cznbgfOJO5vqahwn5HBiVZH1EZjk6h65vhgmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oOmbllwkZDI6zpFPJDQgCUplRZoKDrq18c3jkZhMbNUzl9nFxdfiu0L4ok9ewG84A 08RJ1VRFML6OO2Tb7HR7qxOhxDvpJZRduOtY7D6nxxOim8uqO8CuYOjNil1gNn7r0L jkXpkKz6qU6nGBVwef7dKUvXf1QxzaU3BvsCVEbA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391621AbgAPXd7 (ORCPT ); Thu, 16 Jan 2020 18:33:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:44796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391602AbgAPXdy (ORCPT ); Thu, 16 Jan 2020 18:33:54 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BCFF0206D9; Thu, 16 Jan 2020 23:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217634; bh=Bytc26cznbgfOJO5vqahwn5HBiVZH1EZjk6h65vhgmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y+aynqFBIPiRe/aVK4LzMpT6DGRY+1nrVtW955/2ieDM+Wy/fwgWr8/sBJFHHL2LT qroUMACQxvcjof2BlBW+9UuFFoc4DMGCU9ezYTRp/Z3/g41c3V7Q2qy7QeazEAqPLY te/NcLIcD4OABiWko1WI9ZXsnygpPxip/9pd5DbI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johnson Chen , Linus Walleij , Sasha Levin Subject: [PATCH 4.14 62/71] gpio: mpc8xxx: Add platform device to gpiochip->parent Date: Fri, 17 Jan 2020 00:19:00 +0100 Message-Id: <20200116231718.030165577@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231709.377772748@linuxfoundation.org> References: <20200116231709.377772748@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johnson CH Chen (陳昭勳) [ Upstream commit 322f6a3182d42df18059a89c53b09d33919f755e ] Dear Linus Walleij, In old kernels, some APIs still try to use parent->of_node from struct gpio_chip, and it could be resulted in kernel panic because parent is NULL. Adding platform device to gpiochip->parent can fix this problem. Signed-off-by: Johnson Chen Link: https://patchwork.kernel.org/patch/11234609 Link: https://lore.kernel.org/r/HK0PR01MB3521489269F76467DFD7843FFA450@HK0PR01MB3521.apcprd01.prod.exchangelabs.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpio-mpc8xxx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index e7783b852d69..d5f735ce0dd4 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c @@ -306,6 +306,7 @@ static int mpc8xxx_probe(struct platform_device *pdev) return -ENOMEM; gc = &mpc8xxx_gc->gc; + gc->parent = &pdev->dev; if (of_property_read_bool(np, "little-endian")) { ret = bgpio_init(gc, &pdev->dev, 4, -- 2.20.1