Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2054230imm; Thu, 2 Aug 2018 05:36:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfYoHPfpUEfPOmtLiGtSdae3OG6gcHC3HUrfMyHxUDkad19ZszNo1FbWi9nKleSv49s70Cr X-Received: by 2002:a62:9683:: with SMTP id s3-v6mr2793174pfk.191.1533213404712; Thu, 02 Aug 2018 05:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533213404; cv=none; d=google.com; s=arc-20160816; b=l6GxUGw0jdsAtQKX63KhwvwKad+VOlNXoVBijDijhOuFRsZCoroCvuT2Lw6T0668LS PUZoj6Yd1IPvaNKDBJvX+NcOeMKC805ua3LIxzy38fbLXQRigbBrHH/Mkj/K2SZmEifU EM2SOsJaj8HI6Bw1Sn3uVHM76pNxo9oSeI5Kgg8CBn8r2w9dj8exvA1ZN+VEgKKc7fAR b3eB+ehDBnShNhhAN43dRcsL7PP6g7u2fzrVa6hzytXNHX5r2RERDpjeLOwOGn92lHBg ax3g02vDI5x+MH5szHYIpRi8KRJQpW/11cxiiHrObbDiyrst6bFUlhtLUDrQvQizUKqU LZgw== 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 :references:in-reply-to:mime-version:arc-authentication-results; bh=7DCWJglOQ0mQL+I0daK6/Gn+szbgcigc3fYoV9GO8g4=; b=C9+po05Q0d1NZNy/BDv5toK7RS8f3hdJuBnYOnu2gRgCxdjwifrj/QLiAguemrBZXM w+0W+xcSvJk0FOO/KApWOZ/8kv7eCjN03CUsk9ldVvAlpjABxqvxC/G63vSYS/6PB6mO 6y22gVhovM5hQiRU4T2km+HeJfu4tKUk/eJx18UNGIfG+AEEzVd3Ri5xNhqi7sVp+SNN QJjSuxhibx53pjGc8ElgR1+8KBoxEaDpxLprqq5rOG+o6t4gW1MaKv9NT+8/cy+OulBq XzW1CQxQjcPzAIZlgfotS2h4BVqop5gfTF3L36vKQ2EOmj0AqYW73vB241snCyYVFgUU gFkw== 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 g34-v6si1332968pld.244.2018.08.02.05.36.29; Thu, 02 Aug 2018 05:36:44 -0700 (PDT) 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 S1732272AbeHBOZs (ORCPT + 99 others); Thu, 2 Aug 2018 10:25:48 -0400 Received: from smtp01.smtpout.orange.fr ([80.12.242.123]:28045 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731447AbeHBOZs (ORCPT ); Thu, 2 Aug 2018 10:25:48 -0400 Received: from mail-qk0-f171.google.com ([209.85.220.171]) by mwinf5d24 with ME id JCal1y0093iUoqR03Calbh; Thu, 02 Aug 2018 14:34:46 +0200 X-ME-Helo: mail-qk0-f171.google.com X-ME-Auth: bWF4aS5qb3VyZGFuQHdhbmFkb28uZnI= X-ME-Date: Thu, 02 Aug 2018 14:34:46 +0200 X-ME-IP: 209.85.220.171 Received: by mail-qk0-f171.google.com with SMTP id v17-v6so1362537qkb.11; Thu, 02 Aug 2018 05:34:45 -0700 (PDT) X-Gm-Message-State: AOUpUlGJ0RtiFbPwBZrZ7ZqUGXi1moEX3KxzaLTufmoH3ovL5tbvrErv ngMDy/ok6/8LIiqZyg7AuYFhCT705kCellsiLus= X-Received: by 2002:a37:b446:: with SMTP id d67-v6mr2293163qkf.104.1533213285136; Thu, 02 Aug 2018 05:34:45 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:278a:0:0:0:0:0 with HTTP; Thu, 2 Aug 2018 05:34:44 -0700 (PDT) In-Reply-To: <744700e43aed3880807f86abde0caf3df1127e60.camel@baylibre.com> References: <20180801185128.23440-1-maxi.jourdan@wanadoo.fr> <20180801185128.23440-5-maxi.jourdan@wanadoo.fr> <744700e43aed3880807f86abde0caf3df1127e60.camel@baylibre.com> From: Maxime Jourdan Date: Thu, 2 Aug 2018 14:34:44 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/4] drm/meson: convert to the new canvas module To: Jerome Brunet Cc: Maxime Jourdan , Neil Armstrong , Kevin Hilman , linux-arm-kernel@lists.infradead.org, linux-amlogic , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org 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 Jerome, 2018-08-02 10:39 GMT+02:00 Jerome Brunet : > I looks like the consumer of your 'canvas' devices must know how the canvas > device is organized internally. Maybe something better can be done ? > > Your canvas driver could provide a consumer API, for example: > meson_canvas_get(): to translate for struct device_node to whatever abstract > pointer you would need. > meson_canvas_alloc(), setup(), etc ... > > ... This is just adding a bit of indirection but it would help hide the plumbing > of your canvas driver from the consumers (and repeat this code in each). This > might be usefull if you ever to make this canvas driver evolve. Overall the inner workings are hidden as there is an ops struct instead of public functions. I agree that the "fetch the node" boilerplate code could be put behind a helper, but at the same time this code helps remind the developer that there needs to be a canvas node in the dts, and that it has to be linked in your own device node. I would like to keep it that way if that is okay with you.