Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3369297rwb; Fri, 20 Jan 2023 15:16:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXveE5t+2HN1XCrjVDGIpA49toF4Anvl/flG30Q3se8fGiMh6XrmH9Xk2ApZVt+h5+RkA3Ia X-Received: by 2002:a05:6a21:1690:b0:b8:e25f:e2a6 with SMTP id np16-20020a056a21169000b000b8e25fe2a6mr15609307pzb.57.1674256579532; Fri, 20 Jan 2023 15:16:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674256579; cv=none; d=google.com; s=arc-20160816; b=F5mnq22L/JBO00lj2vpuERUFNJkhtxlQxqFBTskykHBQ6vfa5wsOOFt9ntGba1/Wei s4D2UvvfkI2whD3Puy4M32GHLIx2j+8vZJuK94sOuxlP999Gnc5JYNEPaD5j7Wstf5AG jVMPwvN6ZVIBlFEHZ+Qr5XmWHbkdvyTNY2FU6AxPF3rmUFxjeLUByimIya/oaiRRAWQp Wd29AIFoG/x1fwXIIW2+NGS4R7CMhc5Nax5RHGLMpv/LwIQ5cZejaqU2/kdzx3Ui8PQ4 lrISfGDb45RATXdg5zTAE8V/7AKYvrsExXSEkAmvGDLdNKQUZ6+3daAlqs0n3N1TiY9y H3fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Uni4fgWzey2A2pr/65sW4fSjZ1BK0qfdeoeclceKc+I=; b=X7kxeMtASBY60FwgW3An7IvmoE7Y9N3uvQRk52gbCXVKmWc4r7wDMVYTX78phSwB0m cJ/dx36yLnKmrfhzAo511vGbUZ3QNjiFN7wAl/TVENRXRvG4JNW/Quz2UoUTMB6SA6dH sds1I3r2gNwQSEjlllYVVLH+HK0Nn+klTLuswclhgzqpXtPnXD0Lnu/vQZnM8ejIH9ST 34KY9h47V8XgcXti88N+slI0bRshhK3DHXH7ISH8dkQdZAPBQV3moR7uY+qXSSFl7SPI SNTiIrWCqGy6zwDQVYjqO/3JSZjiE1qD0cNWDD+yUTcoAv+wkciSN8CbcVQapOcht392 6pwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p587u395; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r20-20020a6560d4000000b0045c88c3b799si39425963pgv.709.2023.01.20.15.16.11; Fri, 20 Jan 2023 15:16:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p587u395; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229623AbjATWoT (ORCPT + 50 others); Fri, 20 Jan 2023 17:44:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbjATWoS (ORCPT ); Fri, 20 Jan 2023 17:44:18 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67D2813DC6 for ; Fri, 20 Jan 2023 14:44:01 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id d4-20020a05600c3ac400b003db1de2aef0so4706415wms.2 for ; Fri, 20 Jan 2023 14:44:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Uni4fgWzey2A2pr/65sW4fSjZ1BK0qfdeoeclceKc+I=; b=p587u395pzhdB1gao6W8PwGUdEh0uuwLLyLD0oCi2QsiNyXvUhdZ7UYWqIjlE8qtF8 PIwCWEOuQw3HEf7nVesE8DnpT6plVIKMIvGLvSvQR40MUXDgWUUJMsD4/wJW6n/8MiJt hesXHJB9ytz+ZbOsYOFhHVJediFtzXim9MvQO44xUqF5c9soPa0e6/ADR8s1SLgT+qWw CJWXxTLF9NZfQ9oeoIQVgyopDsRvYx8pXpZV7TDwnjwtlOtFiJXCcvOsBjANblgIlg6W jArcVnSXy1bKKfZzXeYeg91cCjQn3lzFkA5ib9QHryDkj7jNDBSJxZS6DQLcrCOOVVB2 JRcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Uni4fgWzey2A2pr/65sW4fSjZ1BK0qfdeoeclceKc+I=; b=Fu0BPOvMrWPHZHm8ZRzY1ndqcy/mjLXuN7F0Z4O1DXodA/S1qmdK0vrafghSppKPyO hmJ4zJetq4ieppHW1H8DHVdrA6BUVaWYANsqS7FJ/Ue6wYIz9vyQgYiyrHCdzlAPp3EQ 0psLHh1h/c+ptD1FbuG/xAXGJiApl4RaZ7shnZs14tNGGd77wJ2X7iQ5XYaZdayLxZ2z codH9ojEe8hwGbU25p8BzwXjeyAeC+VP75PtO9RR81bq8HYFR5N+Um7WwxEgaORhbBLM D27Wmpk+CXb1DFDaiibDcQHlIPkoubgWeQuGVXs9Mor6CRj46PSiUXIH4ITfU3Leuz9o CFRg== X-Gm-Message-State: AFqh2koS2XvQ5jcdCq1+FpkVfairqag2S2bBOyC6OiSwqxSMZmh8aPDm 42KqfchTMm4Wh9qpXV+GEQa8PQ== X-Received: by 2002:a05:600c:5409:b0:3da:f66a:e866 with SMTP id he9-20020a05600c540900b003daf66ae866mr15767602wmb.10.1674254639777; Fri, 20 Jan 2023 14:43:59 -0800 (PST) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id bg1-20020a05600c3c8100b003db09eaddb5sm12011498wmb.3.2023.01.20.14.43.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Jan 2023 14:43:59 -0800 (PST) Message-ID: <4c532a7b-d5b4-da5e-5703-c6f8ebfbc62b@linaro.org> Date: Fri, 20 Jan 2023 23:43:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v1 2/2] thermal: Fail object registration if thermal class is not registered Content-Language: en-US To: "Rafael J. Wysocki" , Linux PM , Greg Kroah-Hartman Cc: LKML , Srinivas Pandruvada , Zhang Rui References: <5905717.lOV4Wx5bFT@kreacher> <4780418.GXAFRqVoOG@kreacher> From: Daniel Lezcano In-Reply-To: <4780418.GXAFRqVoOG@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/01/2023 20:48, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > If thermal_class is not registered with the driver core, there is no way > to expose the interfaces used by the thermal control framework, so > prevent thermal zones and cooling devices from being registered in > that case by returning an error from object registration functions. > > For this purpose, introduce class_is_registered() that checks the > private pointer of the given class and returns 'false' if it is NULL, > which means that the class has not been registered, and use it in the > thermal framework. > > Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog