Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2370652lqb; Mon, 27 May 2024 18:37:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV5uUr8p9rEvpX/rABIXmLm63UriLzdEk6CQq7Jlm40UswTJJFl3UjJ9H84B7jPNZXOY1pZr+pRPzmZcGCCl5N7AtcIwfdB9SqTzFoYvg== X-Google-Smtp-Source: AGHT+IEGxu1E4/yGa9YwTbUuXR7ssR5EPiPNRyURHu+5dFRostr8LbTP6YJYjznL5GMbsSiI3b5d X-Received: by 2002:a05:620a:13ce:b0:794:c917:fc1c with SMTP id af79cd13be357-794c917fda6mr250839685a.31.1716860243778; Mon, 27 May 2024 18:37:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716860243; cv=pass; d=google.com; s=arc-20160816; b=J8gOJhaXxYutR44516x4LYVhYvDCN/DlQriQtVBy0tNNC3w6ROnOR/FzjaE1mKejuU 4xaj11waV7/RBIQw8Jj7wAHXlVqeeLpd8iINt0jCJNpc1CaRIeaU8IeWccrEBPacy+xn SD2Sr6cSiFdiWDPHAHYd5R2yGW6Q3z1oooue7Fl466/RppEoble8GhQNtCJS2K9a02Bg XcpSIInfu21BNR/2pSMelpQRDNLYpASTdKdPNp7FiS4wYIggIE3hWzjXxQjgIpdtfNYv dy2+qI0rKv+IjzBi6+rH4f4KO0nhRBjTdcpL9LNUCJw797Mt9TEazYw9BZt6CayLr8ot stsQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:feedback-id:dkim-signature:dkim-signature; bh=3bdXh04xDjc3/ImoEZe1VUNcZWPsiJSevANr5wdAkVo=; fh=KBOOsaW3YEneVcYsdRdNlUHz1Q41m6vPI9Uc3mM7Mz4=; b=wFIR7guyrZjIM1WZgth0cNvPVy5YNTW85NkjDCXi2bn6yHQQGjGYW+7EFinJVh1uwg FMkTi5O5JAPH6CtG83yEMsIw5o6c6PX2Wo1SMYbq/yZt7EjCpADvA2Lc/U6qf2cTnOdj DhsfWS5ROGydaEqBqdP43Km/zVctu7o9Ic2VPKfXi77+CwTj1fE5khSofo5h1gRwkboX 4AfA0lJNw1CuvXbgy+mQ6SOB4+Xg3awQewCXP2pRiRbl0T5C5S0WzsjJQOsAkmR7QlQe OHp5G99hlqkqvt2lstjKfl3HxKrHYSYQspskNGG12Z25ZVc2FHJM9bthdkuKlB1U32v3 CKzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=gh7KSpuM; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NSqq02EM; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-191613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191613-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794abcac358si963838085a.91.2024.05.27.18.37.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 18:37:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=gh7KSpuM; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NSqq02EM; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-191613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191613-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 811D41C21A9E for ; Tue, 28 May 2024 01:37:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0225B179A8; Tue, 28 May 2024 01:36:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="gh7KSpuM"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NSqq02EM" Received: from fhigh8-smtp.messagingengine.com (fhigh8-smtp.messagingengine.com [103.168.172.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25D00EEDB; Tue, 28 May 2024 01:36:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716860204; cv=none; b=ZeU/ucGn4WGavvnOC8LdtCFPil/Td8Kg5wFHGFe9pOOswfD9nkyfrmzHdOFj0mJqYDgqa9LFImIMx1kO+h3u6MnvWW/k2koHqXpN5Ipa2dtLDvT9ur/C7/3Rop6VRbCrQExvle7gKMf3QHZVlqiBm3+JDuKUmBqgo+/64WaW9Vw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716860204; c=relaxed/simple; bh=6X5qvdGER3UOQsX0hdA2jSbk0AKoPE1PhDLPSdV9aUA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p0mGmSNWyopHRc2APOY86LYjD4G0cSn8XlyVP3Qv5Pfz1seaURtAu3YPCJEpB/YvMiimgcv2FDBkFKlD/sRka+GzeTWWyT6mR2f2tMim/vWTbgNCGadg1rK6GVhxxNeShKNqsz1DNeruj/i//g88HepFW6tdkLUVHIbS+AkIgvo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=gh7KSpuM; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=NSqq02EM; arc=none smtp.client-ip=103.168.172.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 3253911400D6; Mon, 27 May 2024 21:36:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 27 May 2024 21:36:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1716860202; x= 1716946602; bh=3bdXh04xDjc3/ImoEZe1VUNcZWPsiJSevANr5wdAkVo=; b=g h7KSpuM5ArFiDOkpZ3NDlTY8PoNNKCgNr6iYv9RBjxiYUfUJ7pK3+VY4rUmBzXp+ 5B38SRhbPDfYBGkecEOV+UliGNG5GTGICDTo0ij/oNwQtq6JjGn6TOnO2andKoYz KkhCyOWoj4pR5BnaFvEEbiG12iKSRnt9/4Na4EMc+p9URiDB75ssMgHlDroZsCxV GryGlaUngjBQJIWR2+DvZknmsEfOteH7oLbaxXULehOLVkuIXZE3MuCguHHoKs8O gmm9Yye2+ceQipuQFNP3nx66/c6V4JGNoikWk9xg3CT4OpQ5V4ORJoKmGN0LWcep 5hNtsKdzoD0DnVEpXhSLg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716860202; x= 1716946602; bh=3bdXh04xDjc3/ImoEZe1VUNcZWPsiJSevANr5wdAkVo=; b=N Sqq02EM7QkwCYyabkvCoJ9tuR2ZNr3E8MvnvoSQnvb9IntZ9f3D1CoGcKMnKRNap CWrqqCPYy/M0EzA/EtcB4b4zBI+WRGThnWCVvdVQ4BQzGNScqefa1Je6f6ZuSWCj DVDv0+KOuz8B0q1FLRq9zYtwrZLOw6YzDF+0a8jaKy4PIV96VhNv/RTwtS3tVmHU DCeNnW/xG9jbStcp4EITmlncXPD1Dw0vNzUF8lNEPCjGO//hY55g9bqmf3vs1H8S i8o/hGfsFbBCTCU132vER9umbjVgsI88Wry3/SSKGFiAT2HAfJJZ6ac2zhAlsgl0 4hnz27OOTbLwebz/gzOMA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejhedggeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehl jhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhepgfetfedugfetudeuheetjefhue fggfelleetvdevtefhueeujeefvdegleevhefgnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 May 2024 21:36:39 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: ilpo.jarvinen@linux.intel.com, corentin.chary@gmail.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH 2/9] platform/x86: asus-wmi: don't fail if platform_profile already registered Date: Tue, 28 May 2024 13:36:19 +1200 Message-ID: <20240528013626.14066-3-luke@ljones.dev> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240528013626.14066-1-luke@ljones.dev> References: <20240528013626.14066-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On some newer laptops it appears that an AMD driver can register a platform_profile handler. If this happens then the asus_wmi driver would error with -EEXIST when trying to register its own handler. We can safely continue loading the driver instead of bombing out. Signed-off-by: Luke D. Jones --- drivers/platform/x86/asus-wmi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index adc841abbb2a..999cd658ec8b 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -3836,8 +3836,13 @@ static int platform_profile_setup(struct asus_wmi *asus) asus->platform_profile_handler.choices); err = platform_profile_register(&asus->platform_profile_handler); - if (err) + if (err == -EEXIST) { + pr_warn("%s, a platform_profile handler is already registered\n", __func__); + return 0; + } else if (err) { + pr_err("%s, failed at platform_profile_register: %d\n", __func__, err); return err; + } asus->platform_profile_support = true; return 0; @@ -4713,7 +4718,7 @@ static int asus_wmi_add(struct platform_device *pdev) throttle_thermal_policy_set_default(asus); err = platform_profile_setup(asus); - if (err) + if (err && err != -EEXIST) goto fail_platform_profile_setup; err = asus_wmi_sysfs_init(asus->platform_device); -- 2.45.1