From patchwork Fri Jun 15 12:26:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 138675 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp781342lji; Fri, 15 Jun 2018 05:26:59 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKYpY14yg6+PMpmRSGp1oBkwyqoPn7s+0YhAy36kcEguNgAKveMOhZm0AE96acmuSb2XNE4 X-Received: by 2002:a17:902:e10f:: with SMTP id cc15-v6mr1883099plb.100.1529065619865; Fri, 15 Jun 2018 05:26:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529065619; cv=none; d=google.com; s=arc-20160816; b=mSpMAIxnIqla6iPOU0YBx0v5sk9BAZBbqkRCALe0eowo6mEcw/U59t2weNYtziDrqI gqT6dN/kRpv2YxKbC0v+7UbbLrKbi/+A0pQtkzFcngjPI3uV3inRbwqxS78U598DEDQx pLWWJhLZybe4fsDRq1iHQxCavuMo6Hawyci3ZdDUwgIbA0aU4UwKJb+Wl6wHRg5d/tca q54KtN/Rz9mmND7aEDRipJdJQLJIlFECX8waJqXkLAHMQ4hKO6q07wFuGNzm1nyNf1Ld ht4YJPviqrOQAtK90CDL1VGNdxCJcQ+kJUzGawCxm57J0nwevdwgwMZZTwRYm+g1cLki FwTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=7uIfUi5gFs9XweJjSzCtRsrVskM/JAeU5WiHrKZ0ZAE=; b=N8GdIqh1YR+itXdSnBB2Wa5jCXQSATbZCBVaHUu5JrIpdanpDU8OE/Jlj1/+id+w+w 47REh0/a/1wrGe5sT51amudazncWPM1ivPr6qYW/IiRQE0CDEH7M4aEOepztAbZ1Mmbu H85UacXRhcDpH4tz+RZtlBZa1Z0p5TCo3Msu+z05PtNvgEcHJ726UZh8OYtr7Sk/+Sl4 lpYaHitDWpRRR/qA/bCMI2ftsyxqdCJAgPBYcUaow5tLnLGzbw+bWikdpDb0SK1VlP3T duydnIF3X7YiZZM3o0yhs+UoArBoMRCobeDifH/+xLUX9XtN+z+XPBA9zZannFEy4SSM 49hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b="QTC07Ov/"; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5-v6si6341512pgp.105.2018.06.15.05.26.59; Fri, 15 Jun 2018 05:26:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b="QTC07Ov/"; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755897AbeFOM07 (ORCPT + 3 others); Fri, 15 Jun 2018 08:26:59 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:52897 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755749AbeFOM06 (ORCPT ); Fri, 15 Jun 2018 08:26:58 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180615122656euoutp02c4291d2a2e95b473024723efb0387861~4VROZTEOc3214032140euoutp02g for ; Fri, 15 Jun 2018 12:26:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180615122656euoutp02c4291d2a2e95b473024723efb0387861~4VROZTEOc3214032140euoutp02g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1529065616; bh=nFE+yBt0xTQ0RgZwIOhs06rGvzrW/KFO+mUHssJ1cOc=; h=From:To:Cc:Subject:Date:References:From; b=QTC07Ov/M2iQUOIGHY46DouGQurKrZP/4okCbOKzxyzJ4huU8a7M5rjVxaibh5HEs S1IF/q4quHQAtubYNKEzWIkUd5Lmvu9lAh7ac5licHNYUF5cyfQ1xqtUDnslSyi6vo Gl+1v7s4VpbIx34Q9/2LoHvzFk7jtI3o99khAgC8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180615122654eucas1p153d8df6800b0134babad19c82d078dc0~4VRNRuxhq0744707447eucas1p1C; Fri, 15 Jun 2018 12:26:54 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 23.3C.10409.E80B32B5; Fri, 15 Jun 2018 13:26:54 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20180615122653eucas1p2254aad8e6497ab1bcf11eb5c7fa6b063~4VRMRscw30433304333eucas1p2B; Fri, 15 Jun 2018 12:26:53 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20180615122653eusmtrp1ebb08015bb01237be8d43b830c78ae67~4VRMA54W91501415014eusmtrp1w; Fri, 15 Jun 2018 12:26:53 +0000 (GMT) X-AuditID: cbfec7f5-b5fff700000028a9-56-5b23b08eff3e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id EB.6F.04183.D80B32B5; Fri, 15 Jun 2018 13:26:53 +0100 (BST) Received: from AMDC2765.digital.local (unknown [106.116.147.25]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20180615122652eusmtip1d495b844aff301e54e65fe60141fa02b~4VRK79_ij0905209052eusmtip1n; Fri, 15 Jun 2018 12:26:52 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Andrzej Hajda Subject: [PATCH] drm/exynos: gsc: Get device id from OF alias Date: Fri, 15 Jun 2018 14:26:43 +0200 X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCIsWRmVeSWpSXmKPExsWy7djP87p9G5SjDbY8VbG4te4cq8XGGetZ La58fc9mMen+BBaLGef3MVmsPXKX3WLG5JdsDuwe97uPM3n0bVnF6PF5k1wAcxSXTUpqTmZZ apG+XQJXxr+7NxkL3nNUfDhf1MC4lr2LkYNDQsBE4smPmi5GLg4hgRWMEhv2rGCGcL4wSjTM PcAI4XxmlHh+7DJQBydYR9vh76wQieWMEidez2EDSQgJfGWUWPIkBsRmEzCU6HrbBRYXEXCT aDo8E6yBWeAmo8SfJ+sZQRLCArYSR6bfAytiEVCVWHj2NCPEBnmJ1RsOgN0hIXCETeLNo6dg RbwCZRInN3xggyhykdi+4R8zhC0s8er4FqjzZCROT+5hgWhuZpRonzGLHcLpYZTYOmcHVLe1 xOHjF1lBQcAsoCmxfpc+RNhRYspSkHdAIcMnceOtIEiYGcictG06M0SYV6KjTQiiWk1i1vF1 cGsPXrgEdY6HxPyLt6CBEitx+dUVpgmMcrMQdi1gZFzFKJ5aWpybnlpsnJdarlecmFtcmpeu l5yfu4kRGPen/x3/uoNx35+kQ4wCHIxKPLw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FxIgCG/yFKTgIAAA== Message-Id: <20180615122653eucas1p2254aad8e6497ab1bcf11eb5c7fa6b063~4VRMRscw30433304333eucas1p2B@eucas1p2.samsung.com> X-CMS-MailID: 20180615122653eucas1p2254aad8e6497ab1bcf11eb5c7fa6b063 X-Msg-Generator: CA X-RootMTR: 20180615122653eucas1p2254aad8e6497ab1bcf11eb5c7fa6b063 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180615122653eucas1p2254aad8e6497ab1bcf11eb5c7fa6b063 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Platform devices instantiated from device-tree always have pdev->id set to -1, so use of_get_alias_id() helper to retrieve proper device id. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index e99dd1e4ba65..a63287597985 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1196,7 +1196,12 @@ static int gsc_probe(struct platform_device *pdev) struct exynos_drm_ipp_formats *formats; struct gsc_context *ctx; struct resource *res; - int ret, i; + int ret, i, id; + + ret = of_alias_get_id(pdev->dev.of_node, "gsc"); + if (ret < 0) + return ret; + id = ret; ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) @@ -1254,7 +1259,7 @@ static int gsc_probe(struct platform_device *pdev) } /* context initailization */ - ctx->id = pdev->id; + ctx->id = id; platform_set_drvdata(pdev, ctx);