From patchwork Tue Jul 21 13:50:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6836571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 57C8E9F38B for ; Tue, 21 Jul 2015 14:01:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8CF3F206A0 for ; Tue, 21 Jul 2015 14:01:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 92D4B20670 for ; Tue, 21 Jul 2015 14:01:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZHY4w-00045N-TS; Tue, 21 Jul 2015 13:59:30 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZHY2y-00023I-Kf for linux-arm-kernel@bombadil.infradead.org; Tue, 21 Jul 2015 13:57:28 +0000 Received: from mail-wg0-f51.google.com ([74.125.82.51]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1ZHY0r-0000Lj-07 for linux-arm-kernel@lists.infradead.org; Tue, 21 Jul 2015 13:55:19 +0000 Received: by wgkl9 with SMTP id l9so156901394wgk.1 for ; Tue, 21 Jul 2015 06:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=aUEv0D0RMWqPFsZR8rLUV6Vld0A93tAYp1eCSGoahHE=; b=AfSAKfcov75/zpcPJ3NfKgCrGCfMSskVqFbBfFJQurkAIP52mz8C1vNccmF9Eiz4tf T42oZ4LQ5xEA74Y+bBpzWHxyDpbqC0RXw+0wQPgUElGg6rRRyA00cfTEdcwuN+HxffwG CMaIlTn/tsefPdMQ2VU1K/E2Fwwe8H0BiPFNfTh4U+kB0SyB3zrFR+L9cTe7ZjFcNHGW LnGwKDgYYxj4QGLYS9BWTz5LBRk/nRTrGP+5q/wfurG38feCK/9RVkjdirNtPbwRed6k 2pntCygXZHCProzSXX51chnAG3sSw8hiwCfb6Ew5bkbPqwvogUFe9HSwd9hXVcCySG+O I1JQ== X-Received: by 10.180.208.114 with SMTP id md18mr32166116wic.31.1437486725946; Tue, 21 Jul 2015 06:52:05 -0700 (PDT) Received: from cizrna.lan ([109.72.12.178]) by smtp.gmail.com with ESMTPSA id pf4sm37172056wjb.23.2015.07.21.06.52.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jul 2015 06:52:05 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 12/16] Add DEVM_TEGRA_OUTPUT() Date: Tue, 21 Jul 2015 15:50:54 +0200 Message-Id: <1437486658-28365-13-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1437486658-28365-1-git-send-email-tomeu.vizoso@collabora.com> References: <1437486658-28365-1-git-send-email-tomeu.vizoso@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150721_095517_168863_350C5947 X-CRM114-Status: GOOD ( 12.37 ) X-Spam-Score: -2.4 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Tomeu Vizoso , Stephen Warren , "Rafael J. Wysocki" , Mark Brown , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Tomeu Vizoso --- drivers/gpu/drm/tegra/drm.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h index 70930d262caf..8427f6b0832b 100644 --- a/drivers/gpu/drm/tegra/drm.h +++ b/drivers/gpu/drm/tegra/drm.h @@ -236,6 +236,21 @@ void tegra_output_connector_destroy(struct drm_connector *connector); void tegra_output_encoder_destroy(struct drm_encoder *encoder); +static inline int devm_acquire_tegra_output(struct device *dev, + const struct devm_resource *resource) +{ + struct tegra_output *output = dev_get_drvdata(dev) + resource->offset; + + output->dev = dev; + + return tegra_output_probe(output); +} + +#define DEVM_TEGRA_OUTPUT(_struct, _member) { \ + .initfunc = devm_acquire_tegra_output, \ + .offset = offsetof_t(struct _struct, _member, struct tegra_output), \ +} + /* from dpaux.c */ struct tegra_dpaux; struct drm_dp_link;