Received: by 10.223.185.116 with SMTP id b49csp1634822wrg; Wed, 14 Feb 2018 22:06:47 -0800 (PST) X-Google-Smtp-Source: AH8x227XBJZYGQ256njY/r1ZRUJCxsSNZHJYLxBOMXD7EBSw2K5amwACDmgGvWjgWlb5wpnufrEZ X-Received: by 10.99.116.9 with SMTP id p9mr1306754pgc.437.1518674806881; Wed, 14 Feb 2018 22:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518674806; cv=none; d=google.com; s=arc-20160816; b=j4OB0KfGEHayTKJz75818z2uC1062+2CfyM5hRdLf+4Rp5+Prqo0ApNQkj7tNb75Jd 2qUY9UtInQFqaL/5SWYXdxAUgrRHCYBJUpW8SRtdLvU49JarQwLkjmF2aMV+p9yzmhWe 9BIT61cznpE/t5aObXjROBT1LcXCCS/NbIfmjBS4g9TMU+Sfnl4rfYtBXIWGTIWwDEsI EstK9N/IFDh5ZJdCZS5RMef1kKKRQV04B9+MtymHGQ9PKDqtIVfIor5gvN5a++W2KaHN rteMrGmBQoBQqE6vC6zH9jOEX0x64/G/bXxXPaXnwmeuJOf/haFRNP1H2epgm9M2Mifi 3CSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=gIu0Px+Gm5dWbEn/lF2FbimP1QuFj5HGoPg5JEVOyAo=; b=zg8PonkH1bgfyfRmk5u6UxTQD70F+pRHr5yci87AWV/LjIW1BLWSPdewQU/qPNWeLU Z356RyEc/V+fFIi/Dfyn3F3V7LbFmVfK7AlsV38pBKF0mMvYZrQWnHwv2+f+3FavHHoP vVztqu0egh8OY+o3plexoFO44rExrH51xXnZ5zO9DqIp5lm0xDktxvKZE8KCrtpdwk3H dYn0JND6lXRtm2mreS0l7hgfV7+ESG25KpsDqOkULPGjwHcONJ7iMLAZCCdR1MxZ0Tll 2BA/GjbCRYRq00dhDsXchl2qIgRDgv6Gt6mXLPJlaa/wX1dTzaOPqS8o6dFKz1A3SmWD Z0eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=gdviYvF3; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l12-v6si2265798plc.751.2018.02.14.22.06.32; Wed, 14 Feb 2018 22:06:46 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=gdviYvF3; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754898AbeBOGEi (ORCPT + 99 others); Thu, 15 Feb 2018 01:04:38 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:36971 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754886AbeBOGEf (ORCPT ); Thu, 15 Feb 2018 01:04:35 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w1F63gd3014731; Thu, 15 Feb 2018 00:03:42 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518674622; bh=RsNBvsL2o/K2lFzFhfJzQkjlmP8fqsH427QXckCtQi8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=gdviYvF3s+F+gOKYNi5ymgLEf9GpZUI5JVB9ixGfMFoDzGV6kZ3S1OSf/wLTNqH2o oy0q+W9z7Vw8qHqDO0Fe9mUhDdBixU3NgdGzKvr4Z5uaSVdKORGev0zRS9I0SsYjoS LXwXM4utu3KBQukuWue5fKgY7d/JYkI5bIAZImS8= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1F63gXf009677; Thu, 15 Feb 2018 00:03:42 -0600 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Thu, 15 Feb 2018 00:03:41 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Thu, 15 Feb 2018 00:03:41 -0600 Received: from ula0393675.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w1F62uf8020364; Thu, 15 Feb 2018 00:03:37 -0600 From: Keerthy To: , , , CC: , , , , , , , , , , , , Subject: [PATCH v11 08/10] clocksource: timer-ti-dm: Hook device platform data if not already assigned Date: Thu, 15 Feb 2018 11:31:49 +0530 Message-ID: <1518674511-26421-9-git-send-email-j-keerthy@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1518674511-26421-1-git-send-email-j-keerthy@ti.com> References: <1518674511-26421-1-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ladislav Michl In the case of device tree boot the device platform data is usually NULL so hook the platform data obtained from the match. As part of un-constify the platform_data pointer. Signed-off-by: Ladislav Michl Signed-off-by: Keerthy Reviewed-by: Sebastian Reichel --- drivers/clocksource/timer-ti-dm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c index 864019d..c5a49a3 100644 --- a/drivers/clocksource/timer-ti-dm.c +++ b/drivers/clocksource/timer-ti-dm.c @@ -806,14 +806,16 @@ static int omap_dm_timer_probe(struct platform_device *pdev) struct omap_dm_timer *timer; struct resource *mem, *irq; struct device *dev = &pdev->dev; - const struct of_device_id *match; const struct dmtimer_platform_data *pdata; int ret; - match = of_match_device(of_match_ptr(omap_timer_match), dev); - pdata = match ? match->data : dev->platform_data; + pdata = of_device_get_match_data(dev); + if (!pdata) + pdata = dev_get_platdata(dev); + else + dev->platform_data = (void *)pdata; - if (!pdata && !dev->of_node) { + if (!pdata) { dev_err(dev, "%s: no platform data.\n", __func__); return -ENODEV; } -- 1.9.1