Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5759081imu; Tue, 13 Nov 2018 11:15:47 -0800 (PST) X-Google-Smtp-Source: AJdET5cOGMl8CUnZYMn2iC9Zd3PhY70E/lsmBNMxo1FtUqL1jqD5L1aMyzw2rLqiw8dCj3xxqZUN X-Received: by 2002:a63:3858:: with SMTP id h24mr5731432pgn.300.1542136547108; Tue, 13 Nov 2018 11:15:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542136547; cv=none; d=google.com; s=arc-20160816; b=cBLx1eDO45AVHddnn4M3ZFpHdKdtXEiNajs0eORmW4vAEdwBjCEIgomYRd79YCX0Wt IT3RDx8KJLsU/gDWv3Mgipu1VvscPQ8HJLjXlUw5vCwHdqTNy1iCq+TxWPEQ1iZMwa6H KeinTUJGar8eTKFPfgK3iPTz/M5Xz0oQGHWwvhr01+P0i7yfEVzlSRUSt3yJqQsKtE2S 5AzMFhf+Q+8pOUli1mhG2SBGtntjNSUlwYwejDz2hxItP3GXWHUJ4vfyuI1RJJKCQdSJ UsmxgyOS/2jrcWnaiPyDqSS1KX8aWzAVLfj8FT4LN54vjXcGOdcgIHCsZPhkNYMAd2EA SFMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=xxuIJbEBct/MZI5i7pQczZgRzkCtJKgivk1A3FAOzG8=; b=UrUv8uz7CSh+n+hXY3k5tl4QcG2I8PvNe/tVyqVCxNhVU3nEAO5MRHNsdwzWRReBck t1wsQi90Rd+kP2LyvISQG/prWn/bZjJa4HvbRsxCba5D/bIJ/g2dVQCh15lAMserRbAD cO/HMI1RqbC/185Bej6Ol3oXcdEswVN76b70yKYO+alxoAm1S2Oekh92DjCHS70i5E3z ZuQ9n9hLQv53G3ZelWiIsqu4LM2149BSmhXUzHqJ5rEm6h1nLvQ0cAUDFUPGso5dr8Kn TJb/IMMryYwEw4yOy4Q6vkrgN5uyqwTJ7QxQbK4vgc4VTT/qWi+LjlcQ0xIxIFf1rkfp ob3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=dJ7JI4ED; 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 j191si21080696pgc.15.2018.11.13.11.15.30; Tue, 13 Nov 2018 11:15:47 -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=dJ7JI4ED; 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 S1726418AbeKNFOf (ORCPT + 99 others); Wed, 14 Nov 2018 00:14:35 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:35808 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725748AbeKNFOe (ORCPT ); Wed, 14 Nov 2018 00:14:34 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id wADJEFNx070232; Tue, 13 Nov 2018 13:14:15 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1542136455; bh=xxuIJbEBct/MZI5i7pQczZgRzkCtJKgivk1A3FAOzG8=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=dJ7JI4EDuBZbJU4bwlVig/h2Q62MAKT/PifMrVvYXpZZ8YA+jTH3ut/08KFypCM3F RK0H2ZMoJLN+z1HEHlHefDjyjsia15WLBBq0QNi5h86Tt6atRI6p+VpQ8VQ0nz+yGt Jl5cusZEpdTjvETzZMxo2ZCoYDEjK6K4DswpBH3Y= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wADJEF53012625 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 13 Nov 2018 13:14:15 -0600 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 13 Nov 2018 13:14:15 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Tue, 13 Nov 2018 13:14:15 -0600 Received: from [128.247.59.203] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wADJEF43014970; Tue, 13 Nov 2018 13:14:15 -0600 Subject: Re: [PATCH v3] cpufreq: ti-cpufreq: Only register platform_device when supported To: Johan Hovold CC: Viresh Kumar , "Rafael J . Wysocki" , , , , , Keerthy J , Tero Kristo , Tony Lindgren , Nishanth Menon , Stephen Boyd References: <20181113173912.27643-1-d-gerlach@ti.com> <20181113175853.GN13311@localhost> From: Dave Gerlach Message-ID: Date: Tue, 13 Nov 2018 13:14:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20181113175853.GN13311@localhost> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit 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 On 11/13/2018 11:58 AM, Johan Hovold wrote: > On Tue, Nov 13, 2018 at 11:39:12AM -0600, Dave Gerlach wrote: >> Currently the ti-cpufreq driver blindly registers a 'ti-cpufreq' to force >> the driver to probe on any platforms where the driver is built in. >> However, this should only happen on platforms that actually can make use >> of the driver. There is already functionality in place to match the >> SoC compatible so let's factor this out into a separate call and >> make sure we find a match before creating the ti-cpufreq platform device. >> >> Reviewed-by: Johan Hovold >> Signed-off-by: Dave Gerlach >> --- >> v2->v3: Use platform_device_register_resndata to pass match data to probe to >> to avoid matching again in probe. >> >> v2: https://patchwork.kernel.org/patch/10574535/ >> > >> static int ti_cpufreq_init(void) >> { >> - platform_device_register_simple("ti-cpufreq", -1, NULL, 0); >> + const struct of_device_id *match; >> + >> + /* Check to ensure we are on a compatible platform */ >> + match = ti_cpufreq_match_node(); >> + if (match) >> + platform_device_register_resndata(NULL, "ti-cpufreq", -1, NULL, >> + 0, match, >> + sizeof(*match)); > > platform_device_register_data()? Whoops yeah that's a bit more concise, v4 incoming. Regards, Dave > >> return 0; >> } >> module_init(ti_cpufreq_init); > > Johan >