Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp32319lqm; Tue, 30 Apr 2024 11:47:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW/mc40/6eW0u62Lnxn3bWDHW6DR5C5pKOhhqve0ObjEZTlLld5gLoqVefqHaZbHVjv8zCUUuyfgQoJArZY8Ey4+SGgD/KKXENU2BK5fQ== X-Google-Smtp-Source: AGHT+IGwZf6U5GDn8/R1zzT9NVGaGyiNd4jnyLpwTx6dzqcPmYcr3q4os/F1AAIz2OiUIOpQLRBk X-Received: by 2002:a05:6a20:f392:b0:1a9:c4ca:dc74 with SMTP id qr18-20020a056a20f39200b001a9c4cadc74mr803696pzb.5.1714502833420; Tue, 30 Apr 2024 11:47:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714502833; cv=pass; d=google.com; s=arc-20160816; b=FCi4wIEzJlJz1Cx02KIGd2q0cWCWINzS8e3ueMz6H1iZp066/q7CVOKF/oXwB6UcBu NW9o/EAlJWMlq/fLE7AAeXntKmuY3Xdb4e2q7WCgsQkwNcDoP0LVkud/Ln7klpW6/aAA GS7BgAPHAtZM4sS3S2Ll3VW0PvcibQAj0EmOR8efo6Y3pdpkYa0P5DyI2WWIq9dPd+3S ctxFmSb539nz1EPOXccZC42VpjNCgqVz6zJFuUYmhniIAhjD7qh8NDO/2DN2K2x1fmxh azTOivM8MEMCkgINbgUMtS/P1QvXG/8M0Jctq1hrbgMsWI+LdHAv09oAbdXgZNyNBhIU yuGg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=ZGUPpr9ka2yo3ECRl+7yFv4d0kGzQn5S5/kDIVOZE0U=; fh=ox/jjwc3WO7vXOTLxbNj4wPdYnywXarKuaddzLkHhVc=; b=gmL+z2SUKZtGojKUNemkkbkW71K50oPpFWAfYWDmk4Ju+ScbP5WreZjqlmqPt6wYfT m5hm6FrO/aUyKCgpa0q5WBsHjvCgSqUrSy/Rk3qioS2tcuqWFsv2f7SBfzxWqqQmoA1b Ximk/eBSvCFU78LDfcqBIHsnaRNhTLt3M/WwsbFgwZhxjmgnJW1+hD4w6ZsAn9ZOKmhX I8wlnZQC2yb4gVkGs+SIZMTkPDHqzVAPi+ff/s0yfyp8myLIc1tavnBPR3pgb8jlaxiV zB1yyUWoLd8uEcZARIO/+KDyb2Ppf77/5E1D5zSWi+AMyV6XDmFYHm5OI1tOtA/vWUkz /BoQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Z/Gy4o4A"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-164610-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s9-20020a634509000000b006128546e757si5357280pga.450.2024.04.30.11.47.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 11:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164610-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Z/Gy4o4A"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-164610-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9E0CD28170C for ; Tue, 30 Apr 2024 18:47:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C06AA190672; Tue, 30 Apr 2024 18:47:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Z/Gy4o4A" Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2634A18412A for ; Tue, 30 Apr 2024 18:47:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502825; cv=none; b=BA0gkBzjmG1+R5BrPGiFB3Y+5nxLlYrygV6qYIe2a5kDsCPqzSoaa9X98z4jJQ5wuRxbTvLTpqnkAH2Rd3Rt+mEe0+ugr5zwAoaK6kIfH3E2x2+flnZpe/yRrF5RM7GEzTyD0wU4QCbJ0Ts45mrNNtDWQfOrMD70apDf6IehsXU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714502825; c=relaxed/simple; bh=oFbvGomouOb8wzM7GcwTJ0k1uS7OddQR4amzfZvK6FE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VuaN3qDhuYHWPhYoUYXlTf6fxWhMzuOAKd+siHJUrN3Cf+glivlfiZwQT32/RUD9BODLSYJ4tMIEUVPy5S6TBXTlAkThvQpPdWf7FjhvTeF+MXA6xhAbNxaswCfz/Kkpsv5Y4vZgQsjGHQ7LtapsPiLOPjfRx0D4YABNmm60/sE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Z/Gy4o4A; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5196c755e82so7528793e87.0 for ; Tue, 30 Apr 2024 11:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714502822; x=1715107622; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZGUPpr9ka2yo3ECRl+7yFv4d0kGzQn5S5/kDIVOZE0U=; b=Z/Gy4o4ALnVTB50fcnzVJRekAWA8JElRd1LZWx7MZNlwBW/ol/ZIZXqq8qR/lC3ap/ j6wEc/wg8XFLD5CpPpo6zFCEoe16+jBDFkFnnI41eOQZXSYtWdtEAuboWfsHxgVmvWwa UNWri2oHx9t9l1yThFgiaNMSRHmn5RScj3Ws06YY7EPc8c+t16Z9Y09nsu5Y8wkSGm6C grSweDJtdnt+ZwXh7aLdT29clKYBd+Ozy7Sw8M1mEqZ9y3CYWleRpZTGKEDqE7zc9tRL sM80VAkswi4BGVecbaYfQPUtACFiziUl8TvBneo6+4NiqY7wgiIwURiiwLf6wAmAdPvi ICvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714502822; x=1715107622; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZGUPpr9ka2yo3ECRl+7yFv4d0kGzQn5S5/kDIVOZE0U=; b=G0mA96kAUGmrw40LHl3P7pUICV/05a3OKUwQZ2i01+Seg96f+1ZOgU7tUhawwz5qF6 rWd/KRf11SSnq8t9Q56VnXvDh8at2umnFVMSw46n/Q/Ghc6cg4xuVig9Zq/Wc6ZMva7R NebN5D/BOKPkEFQWDwEYvB0zHmGxgRqhUTICcUPOb1TDZdFMLQEgbUrvoowYqSbymLRd 7iKXuix90u9W5hE5mj1KNGEZwqDp2PH7/2xsRQ7WEQd5/eZ5QycG3tS6cAS2PG0lAoQH y1dPmcUBwtV8mj8N9xALpbqJnktx4OOv9NOJy5G17L+ipXWTmzGL+LqzsI4K/dw4yQhJ hcJA== X-Forwarded-Encrypted: i=1; AJvYcCWW8efefU3ljufHH/8a3b3G+UyYOtrvE+V/6oto165Iz675p9RZ7IZEISC2bFioGJLM01jGiq1tz61/+X8hUWKRweNyTKW1qm10pVG3 X-Gm-Message-State: AOJu0YwHSpZPoexC9nc5gMAvG8rm20v+nJmQnieBKEoNDUFxZG7rcAl8 SbUpk+reonMArf2UmSv7fXTRlh9Tq5+KNz6tvbLUVmASH9ASjmAzzpagiAljitgYPtnr4N/N7yE T5Ms= X-Received: by 2002:a05:6512:3b8f:b0:51c:22fb:182f with SMTP id g15-20020a0565123b8f00b0051c22fb182fmr266000lfv.13.1714502821885; Tue, 30 Apr 2024 11:47:01 -0700 (PDT) Received: from krzk-bin.. ([178.197.223.16]) by smtp.gmail.com with ESMTPSA id wg7-20020a17090705c700b00a55b17418ebsm11331493ejb.89.2024.04.30.11.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 11:47:01 -0700 (PDT) From: Krzysztof Kozlowski To: Michael Turquette , Stephen Boyd , linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , Sylwester Nawrocki , Chanwoo Choi , Alim Akhtar Subject: [GIT PULL fixes PATCH] clk: samsung: Revert "clk: Use device_get_match_data()" Date: Tue, 30 Apr 2024 20:46:56 +0200 Message-ID: <20240430184656.357805-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Marek Szyprowski device_get_match_data() function should not be used on the device other than the one matched to the given driver, because it always returns the match_data of the matched driver. In case of exynos-clkout driver, the original code matches the OF IDs on the PARENT device, so replacing it with of_device_get_match_data() broke the driver. This has been already pointed once in commit 2bc5febd05ab ("clk: samsung: Revert "clk: samsung: exynos-clkout: Use of_device_get_match_data()""). To avoid further confusion, add a comment about this special case, which requires direct of_match_device() call to pass custom IDs array. This partially reverts commit 409c39ec92a35e3708f5b5798c78eae78512cd71. Cc: Fixes: 409c39ec92a3 ("clk: Use device_get_match_data()") Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20240425075628.838497-1-m.szyprowski@samsung.com Signed-off-by: Krzysztof Kozlowski --- Hi Stephen, Please take this patch into current fixes v6.9. Best regards, Krzysztof drivers/clk/samsung/clk-exynos-clkout.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/clk/samsung/clk-exynos-clkout.c b/drivers/clk/samsung/clk-exynos-clkout.c index 3484e6cc80ad..503c6f5b20d5 100644 --- a/drivers/clk/samsung/clk-exynos-clkout.c +++ b/drivers/clk/samsung/clk-exynos-clkout.c @@ -13,9 +13,9 @@ #include #include #include +#include #include #include -#include #define EXYNOS_CLKOUT_NR_CLKS 1 #define EXYNOS_CLKOUT_PARENTS 32 @@ -84,17 +84,24 @@ MODULE_DEVICE_TABLE(of, exynos_clkout_ids); static int exynos_clkout_match_parent_dev(struct device *dev, u32 *mux_mask) { const struct exynos_clkout_variant *variant; + const struct of_device_id *match; if (!dev->parent) { dev_err(dev, "not instantiated from MFD\n"); return -EINVAL; } - variant = device_get_match_data(dev->parent); - if (!variant) { + /* + * 'exynos_clkout_ids' arrays is not the ids array matched by + * the dev->parent driver, so of_device_get_match_data() or + * device_get_match_data() cannot be used here. + */ + match = of_match_device(exynos_clkout_ids, dev->parent); + if (!match) { dev_err(dev, "cannot match parent device\n"); return -EINVAL; } + variant = match->data; *mux_mask = variant->mux_mask; -- 2.43.0