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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 27A19C2D0DB for ; Wed, 29 Jan 2020 20:29:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0709E20702 for ; Wed, 29 Jan 2020 20:29:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0709E20702 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C40A6E438; Wed, 29 Jan 2020 20:29:19 +0000 (UTC) Received: from asavdk3.altibox.net (asavdk3.altibox.net [109.247.116.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A4506E438 for ; Wed, 29 Jan 2020 20:29:18 +0000 (UTC) Received: from ravnborg.org (unknown [158.248.194.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk3.altibox.net (Postfix) with ESMTPS id A47FC20082; Wed, 29 Jan 2020 21:29:15 +0100 (CET) Date: Wed, 29 Jan 2020 21:29:14 +0100 From: Sam Ravnborg To: Andy Shevchenko Subject: Re: [PATCH v1 1/4] drm/tiny/repaper: Make driver OF-independent Message-ID: <20200129202914.GE29646@ravnborg.org> References: <20200122105403.30035-1-andriy.shevchenko@linux.intel.com> <20200124164233.GA6043@ravnborg.org> <20200124173134.GJ32742@smile.fi.intel.com> <20200124181812.GA7883@ravnborg.org> <20200127093939.GR32742@smile.fi.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200127093939.GR32742@smile.fi.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=eMA9ckh1 c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6fEy3RnySyZOTlo2PR8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , dri-devel@lists.freedesktop.org, David Lechner Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Andy. On Mon, Jan 27, 2020 at 11:39:39AM +0200, Andy Shevchenko wrote: > On Fri, Jan 24, 2020 at 07:18:12PM +0100, Sam Ravnborg wrote: > > On Fri, Jan 24, 2020 at 07:31:34PM +0200, Andy Shevchenko wrote: > > > On Fri, Jan 24, 2020 at 05:42:33PM +0100, Sam Ravnborg wrote: > > > > On Wed, Jan 22, 2020 at 12:54:00PM +0200, Andy Shevchenko wrote: > > > > > There is one OF call in the driver that limits its area of use. > > > > > Replace it to generic device_get_match_data() and get rid of OF dependency. > > > > > > > > > > While here, cast SPI driver data to certain enumerator type. > > > > > > > > enum repaper_model { > > > > > + EXXXXCSXXX = 0, > > > > > E1144CS021 = 1, > > > > > E1190CS021, > > > > > E2200CS021, > > > > The new enum value is not used in the following - is it necessary? > > > > > > Yes. It explicitly prevents to use 0 for real device. > > > > > > This is due to device_get_match_data() returns content of data pointer and thus > > > we may not distinguish 0 from NULL pointer. > > A name that told this was not a valid name would be descriptive. > > As it is now it looks like a wildcard that matches everythign else. > > Can you be more precise what you would like to see? > Perhaps simple comment will help? Maybe just add something like: /* 0 is reserved to avoid clashing with NULL */ And then skip the, at least to my eyes, cryptic EXXXXCSXXX. Up to you. Sam _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel