Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp949801imu; Fri, 9 Nov 2018 08:33:33 -0800 (PST) X-Google-Smtp-Source: AJdET5c68Wc360hshc8ySAWGzTemJkCEeZSNYr5fmVqseYl61y1bM+C2PQdJzdCTtZ/Hai/JRT4m X-Received: by 2002:a65:5103:: with SMTP id f3-v6mr8095344pgq.54.1541781213402; Fri, 09 Nov 2018 08:33:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541781213; cv=none; d=google.com; s=arc-20160816; b=FiUl9GKzvlLxO2vXORpPUNg2uQd6vhoJMMe/4L7xlA+zWTM7fLDNUoqECOjKlpYMQM V7T4oD41/44Y1seHUcyr6tv1voNDl9Cn4NmpQNhrnPyzznIXgr2xEbNpzXYmTP/Y8IWL TO7Jr4QGbQBnJP+pGVOH918BZB1G+y27hYWrZxXLq/GBUlhOtRRV2y4yvm/K85pshmqg cUjr1HWFWfTpDYp3r7/H8FbSJFU6ReqsPgWIbE3XWsRm/EowBUy8C6JTXnpSMLe7lpm5 UfG+NQM+H68N+WWX6zGkdELSkGbPsVhIhiw499RVxRuqvAt4Xv2zKud4TU9tfW3JfwYh 6TTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=KMfG77Khthcj5U9G8Z8ObPARPwB1ULu6zMFX2NtHrPo=; b=VTO/aOyTZFY4sSTXKYwKCxWeXUBrA9LkmV5ZmxBwZGVM8MBIkgv+rqfuVH/z1RfxDx +S85w8PfjenqORZw7OH0Tqf3jBVfPt7wryMUeHyJ3AbFhv3Gu1gxVVdqTKTpmVrEojTI /M37JroccFJOuHszT99FUstG+N/j79NA+Je18N6DXA9u27qso/btAiKNzZQgARPu6w4F RsG103hwLePGvsOSMxQX3Um7kxpC9SfW0ALXD/ikDS9dbCCGe7qjM5xanTxs7SPIwvmf 6edohGa2ICXv2BD1VwgPe05LKZ80REdOQMMmkjSjBDrw59TrJ/WFulsePP5+//+DYajo ldfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pofcNiPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j7-v6si7594444plt.349.2018.11.09.08.32.36; Fri, 09 Nov 2018 08:33:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pofcNiPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728571AbeKJCLn (ORCPT + 99 others); Fri, 9 Nov 2018 21:11:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:50676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727845AbeKJCLn (ORCPT ); Fri, 9 Nov 2018 21:11:43 -0500 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1A8A720883; Fri, 9 Nov 2018 16:30:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541781025; bh=e0cgVl2QlG8CrHpu2myDpziM/BVAydAUsg5tbUr7DS0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=pofcNiPpLyVYrdOadj7VTBsAHdLKfgnaEeGxqbsOr3/uDnkYWJN6rfh57InFwo51P oIh/mDv9uCHfIYvlSfPC1aYptHBBvOW8CVJc6JOf+0PcOw1rfWAekEB9GmtRqhwOC5 ybVkYh9JXaIDeUPMCpOTmb1nN6mn+/1u3G352TLk= Received: by mail-qk1-f174.google.com with SMTP id y16so2531330qki.7; Fri, 09 Nov 2018 08:30:25 -0800 (PST) X-Gm-Message-State: AGRZ1gKJOob8uoblD+rsRWJiHMIL7i/5791iw3lmCq6hBQ+hX1iaVgyG BoiJBzndNyVlJCSUzhJvnuEMSEfDbot141iR4Q== X-Received: by 2002:ac8:173d:: with SMTP id w58mr9122465qtj.76.1541781024298; Fri, 09 Nov 2018 08:30:24 -0800 (PST) MIME-Version: 1.0 References: <20181106183609.207702-1-sboyd@kernel.org> <20181106183609.207702-2-sboyd@kernel.org> <154169993998.88331.10494065577891939152@swboyd.mtv.corp.google.com> <0f2bb386-ba92-544c-e980-c95309944b22@gmail.com> In-Reply-To: From: Rob Herring Date: Fri, 9 Nov 2018 10:30:11 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/4] of/device: Add a way to probe drivers by match data To: Geert Uytterhoeven Cc: Matthias Brugger , Stephen Boyd , Michael Turquette , "linux-kernel@vger.kernel.org" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-clk , linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, Ryder Lee , Frank Rowand Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 9, 2018 at 4:36 AM Geert Uytterhoeven wrote: > > Hi Matthias, > > On Fri, Nov 9, 2018 at 11:29 AM Matthias Brugger wrote: > > On 08/11/2018 18:58, Stephen Boyd wrote: > > > Quoting Matthias Brugger (2018-11-08 00:29:46) > > >> On 06/11/2018 19:36, Stephen Boyd wrote: > > >>> +int platform_driver_probe_by_of_match_data(struct platform_device *pdev) > > >>> +{ > > >>> + int (*probe_func)(struct platform_device *pdev); > > >>> + > > >>> + probe_func = of_device_get_match_data(&pdev->dev); > > >> > > >> Shouldn't we check if probe_func is not NULL? > > > > > > Is the oops from the NULL pointer deref insufficient? > > > > Do you think we should crash the machine if someone uses the call wrongly? Or > > should we provide the possibility to error out on the caller side? > > I believe that would be a bug in the driver, to be discovered ASAP. > So yes, please do crash ;-) Depends on the driver. If it's not needed to get a console out, then it should just WARN. Otherwise, you've got to go enable earlycon to see the crash. Of course, someone could just as easily stick data in here instead of a function ptr and we'll be back to a crash. Rob