Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp579135imu; Fri, 9 Nov 2018 02:37:37 -0800 (PST) X-Google-Smtp-Source: AJdET5fui0imhd2ehi+U5dCADxbRXEgiOpOGHiS3GTUpr6Xx4WlopcH2UIgQVbyqAZjrt4j8RxAs X-Received: by 2002:a17:902:112b:: with SMTP id d40-v6mr2945875pla.48.1541759857015; Fri, 09 Nov 2018 02:37:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541759856; cv=none; d=google.com; s=arc-20160816; b=C7g4rNusPLhvMJznc/hqpmqZpn7yKMxNfP/UJH7WZ4sqL3DE9nsoXZxyZ0ocH3jn7b bQoqWRDgQ7R2UJMYMjrLJf1Ask5ihvUOiE+tTIxji30F+plJLB+5WXC4obRKNEX9jzKs 9bDnjBRehjXbxktTpJ/nM3w4/DYP2xqwJTZV29wGvGYuyTGmMaHI2W0c1oOWG/9R82n9 KwRxVqsclpF2aj1KlaGwwQFTWtxOyGuKyIQUvJLQtFfLG8sdZIWRKfbCVvUDooTZxIso ONM8ck9Wxn9Z1MksLpISImfTUTKbGWzC9mejtLt9tkt8jm/O9tcj/je+6JdZ6NYFxFGk Cq9Q== 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; bh=S8vW0xAUgfKUdbaaEaMujTTe8aswgIr8la1V/zBzx/E=; b=VllVqztSt8k/qWIrJNHju7+AT51kG3cHwKuuxQ1GKHc+O4oKoEu/DFovWKAaX+qz9J jC6bgRpNWorc6OlDcfCaNyR8ZXBk98ayoliO6cKnyYC3XHdRVC5vxIF8gPy4qBgV/mmr hrDYS9jYI2/CxIKSAkuHrzX60YiFuxT0wzKOPYutHdAzoC27xTgBgfvafz8q2lfH+KNZ i+Tr0iWdSOqlRETeqDh2xDyK9FlIB0ltE7lxuBrAR6Mmvj8FLkaMXQKGEhLAgn9R0ZhC /b3YMs8PTNvLdOPGAFDRt+3xtDRfRJRKQnAXLdp5CixR4t54mbz3/20k6BcaWMPVngta kl2w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 28si6054637pgz.593.2018.11.09.02.37.16; Fri, 09 Nov 2018 02:37:36 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728140AbeKIUQa (ORCPT + 99 others); Fri, 9 Nov 2018 15:16:30 -0500 Received: from mail-vk1-f196.google.com ([209.85.221.196]:38509 "EHLO mail-vk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727653AbeKIUQa (ORCPT ); Fri, 9 Nov 2018 15:16:30 -0500 Received: by mail-vk1-f196.google.com with SMTP id w72so293621vkd.5; Fri, 09 Nov 2018 02:36:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S8vW0xAUgfKUdbaaEaMujTTe8aswgIr8la1V/zBzx/E=; b=Udn5FiLe9rXFFDDBzZWjEz2tshpZqh9Y05GpmVF0CGqWZUZWDFE3OzSvT/6C4/C5zJ o7WaDxfSfsZ+kaTPXH0a4yGYnqu54UHyzJuju2xb9xfDkyy9gfoex0qLmf30Rzg+nchD BEltPR5ieDUrt3Cea4TRhFcqNI+iHz/l8dVAqGSiwofjN8QvvH4Wz3niztA9xUVpS2Fa H+VUmUbrTMpT16AUaMGe+1vUdvGJcOcqocMV/qmsMcm/F6yAcCUQ+3SyGEUC5mt0ypy0 Nw3NGtuhdrZxvMlvvG0WTCH9wm01u/qhkjY8sv/YoqFyeKHfUCEJGvKp3BY3ShLFDlpB 6CDg== X-Gm-Message-State: AGRZ1gIVfV0xlci+U0SHdAWCVY5pGktGKDgVMY93D4yfFZ0tBpJBA1q3 4wsd9IW7c3b74TRtk4Iju5T5NWMOQZQ9E+KUT6g= X-Received: by 2002:a1f:1881:: with SMTP id 123mr363263vky.40.1541759789855; Fri, 09 Nov 2018 02:36:29 -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: <0f2bb386-ba92-544c-e980-c95309944b22@gmail.com> From: Geert Uytterhoeven Date: Fri, 9 Nov 2018 11:36:17 +0100 Message-ID: Subject: Re: [PATCH 1/4] of/device: Add a way to probe drivers by match data To: Matthias Brugger Cc: Stephen Boyd , Michael Turquette , Linux Kernel Mailing List , Linux ARM , linux-clk , linux-mediatek@lists.infradead.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , ryder.lee@mediatek.com, Rob Herring , 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 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 ;-) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds