From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH v5 8/9] pinctrl: axp209: add support for AXP813 GPIOs Date: Wed, 13 Dec 2017 08:36:39 +0100 Message-ID: References: <20171205144647.17594-1-quentin.schulz@free-electrons.com> <20171205144647.17594-9-quentin.schulz@free-electrons.com> <96bc20e3-97ca-ae76-9e35-e6af644659c7@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <96bc20e3-97ca-ae76-9e35-e6af644659c7-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Quentin Schulz Cc: Rob Herring , Mark Rutland , Chen-Yu Tsai , Russell King , Maxime Ripard , Lee Jones , linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Linux ARM , Thomas Petazzoni , linux-sunxi List-Id: devicetree@vger.kernel.org On Fri, Dec 8, 2017 at 2:41 PM, Quentin Schulz wrote: >> - pctl->desc = &axp20x_data; >> + pctl->desc = (struct axp20x_pctrl_desc *)of_device_get_match_data(dev); >> pctl->regmap = axp20x->regmap; >> pctl->dev = &pdev->dev; >> > > I am using pctl->desc before retrieving it, thus dereferencing from a > null pointer. > > We just have to move > pctl->chip.ngpio = pctl->desc->npins; > after > pctl->desc = (struct axp20x_pctrl_desc *)of_device_get_match_data(dev); > > Linus, I guess that I should send a patch to fix this or is there an > other way not to have to apply such a small and dumb patch? Just send a patch based on my pin control tree "devel" branch or linux-next, it's cool. Things like this happens all the time. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html