From patchwork Tue Feb 13 21:58:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 200692 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp836623dyb; Tue, 13 Feb 2024 14:12:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXkcMK5Gtfqxa4Us9kOnI6vU/UVBukM2+TLEp5Y625H+/uaf914fsMKXvjqCazZu5AeTDgkEWYrMQvjTWWuFR5/XN0TtQ== X-Google-Smtp-Source: AGHT+IH1cJj7YinPRZ9tc9oeEvmnLwvmOG9ZuRZPbitsBV0X8XmNHvnKrdWPxZygKkzs+sxw7Cvx X-Received: by 2002:a05:6a20:d485:b0:19e:b37d:bdb7 with SMTP id im5-20020a056a20d48500b0019eb37dbdb7mr184486pzb.19.1707862345965; Tue, 13 Feb 2024 14:12:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707862345; cv=pass; d=google.com; s=arc-20160816; b=Og2Csl4ffu9ZMjBn0dzR+mRzZK6pBmJ7+TPVZayXgSJTdwnvnU8HLRW8lzi1CexrXc KmMqKIhFMaV8mTPlSU/o7AT6WjgDXghHjDo6vNBfAT50IR/Ve/FvyZLcfnGAk16U8kT0 Sfu9LsXU4BVmy2B2jkfxFIBy6HZod3iiotUu2XNNcBq0U7Asf3ZqpIe8WEV4PMqNfNIJ 3M2oDfEqog7nkufBja5SZwccWLIWouitZOnbQ2D7eGyyNXcuMPooZyQkNtR4lrnOJzkb LkW8bH4PTYPvA8+mRGrBMqBzLg4W5G/RjP/eOzOUbTDVWKYwktgP5SfpbAx16jSDmbbd Yo7g== 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:dkim-signature; bh=fqyuBahTPLTAYF+110cUFRV0sBjf6cZZgU9lFVSbKt0=; fh=B4b0nDLYDKt3HFULHb6ws2S7UTrcMs2gVlRKmiXQcoM=; b=GYg17xs2BcleVlk4d3mvUl95XiCTjfz2j87+WRsQjqg7DBcDH3fCTkGKle8xG+s2LV rrfcq++pevNTZkG8qHHGaM+Fp8Demjq2SBv1avTAY/ZRnmksOzz0oPJSh6TE7qOzvNJT /lXwotRiinBtRydwu7mbBeWQV3GlTmFMmipzNCUtihqYOVXeysYfgkK9XBqI81ka2zLM JunhwPfnMcBRRw7XIBRGLTqLKKFIauyrY8L4aIQGEDxbT10RJUwCWJpcQ5PuwuxV5Aqm cFivaJo8r+TfSz5JpOuzbXcS0UtOsLjIlPifzEkvoL0vqApfhDcMJarjqWiElXoTuC82 oJjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=Y82wqYvx; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-64403-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64403-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWf8QdjLn9fFkk+Q9cOe63Y56sP/ydkQvWwUOTRV1aXACm/gy7h3cV9Q5FOnIhDO0sM30B5GoNk/1oKyjOBjrNyktupXg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l184-20020a6388c1000000b005d8e2f778c7si2579319pgd.294.2024.02.13.14.12.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 14:12:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64403-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=Y82wqYvx; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-64403-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64403-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C9DDE28F0AB for ; Tue, 13 Feb 2024 22:03:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9EF765BD5; Tue, 13 Feb 2024 21:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="Y82wqYvx" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 BBC0E62A11 for ; Tue, 13 Feb 2024 21:58:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707861500; cv=none; b=Jtd8HJHt9vzPxGWt1aq8Vn6UyAjp7QWUdtym2SLBbZfz0+x4i1XQBfXtzhdiKG2Y2ZAxppoGdAAUvi2SD8EEVsCTjIsYv5DBZFgUwlJz6w2r9lDnpERogytLQUvFr1YJkE5LbBqtJC6ctVDIJXVZ6fhOaScxYM/2uqVMczyQkxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707861500; c=relaxed/simple; bh=XCEzGiySNrzVsGywGANcAcUebyxPHAJnm9xzwLcysLY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bAeg/k9ZXIDSammlRiyEMI5nHmR+/UEvfKypBmj1ODtoy8Udqw+PL1ICmamxllwMN8bRQcvr/VjqcA243xjN8kRO2T2EQhJUE5YzkAzV8KRWC28+LI5EwjaNVqLL9uzEaQIEpcnBStNv3NfV4GmwRNwmspCDwCEzAF5P0A9nYIM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=Y82wqYvx; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4114e0a2978so15726715e9.3 for ; Tue, 13 Feb 2024 13:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1707861497; x=1708466297; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fqyuBahTPLTAYF+110cUFRV0sBjf6cZZgU9lFVSbKt0=; b=Y82wqYvxcxh7adCikFQ8fzf9Zs9jaKLOkLJWN2TUWBoC6upJwmFLTnLrlln1oNFudt KbnV9JmcjdOb+K6kY395dYrRU8X+dGrlgLKtKkYJBULnhDJTeunHigTv1c+6rUh5ExmG Zhfwd3EVaGma+hNxPDLI8U7EnB1xCxXSkow3fnituaxCCryk4udu4TlztVP8PRnR3vua 2u0PTo17hVOflZqkwtfQXYUprgniD3zdE3Ix8c3E8g0r6nKiEvR4Mf1pLfGmbMGIBGPo PgMNfVDv0lmPZjflq85U0SRKHuVHcE01bLEHfHDm21UMq9yek0QSMW+/aAC86inV7CQW vMwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707861497; x=1708466297; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fqyuBahTPLTAYF+110cUFRV0sBjf6cZZgU9lFVSbKt0=; b=P16weLiBllAuLw2UicqHgAm0qZ1jwQqOAEXn8zq/Svwgy+a0CkqxR/qEqk0CB93gPS Qa5yVVFUC4DVREITpv7awr4DtCuiH5gMd13EkmGCNqRZuhKKxTy8QNJm1QmaFTY4I3K0 +y+jn9yBFf9C3K7eEErVFoPVe+jjSHymjjsJpfCmh709NC36jvUHIz0deQ8Yh9spTTmM uY10IHNbRhJeguuIOZ/fT/7wYbSe7a/iODyna30ysyEpwR5OeXxCjpdV3WJzlHb4n6Ea 4flcl+AgMBVZ5lkCXPGl635cLOjaRtuGHYDYWX/lqBTJ266xeE2vrZr2Eq8r/i0m8bHy 2lLQ== X-Forwarded-Encrypted: i=1; AJvYcCVfeTbzwJyr7a7S1ys0TnLEn/ok6UzwCAzE8LjJ7i7BV29k6q2JBoHJL+Lj90Y29w8qlPhBYOlGnhPg6KM4IfJymBXpY1mm/FmNS1P4 X-Gm-Message-State: AOJu0YwtV8xfqxZqHWvXaRJTBOWmXWERx4BXgo2IlnFi6zYTQcgjyZvm V/1zS3IwBk2xupIw8N0t/IglXEXZscqnIw0GXXPLZAKV1WyUVHm3CKPKsdzonv0= X-Received: by 2002:a5d:6ac3:0:b0:33c:e2d9:ad36 with SMTP id u3-20020a5d6ac3000000b0033ce2d9ad36mr369591wrw.20.1707861497019; Tue, 13 Feb 2024 13:58:17 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXatIVkhfi4XEgXz5p/gNLbo1vWmEs55v5qyHuI9D0zr8zRt8TJ8ZvxAEkAOJ8a3kznQNaB9CwA0yXFBxNMvj53rHwJ036OVmcocDuLVPfg+PhWLsrC9mlRpniTJxWwH6grCm6vDtmEPJKmWES7/cqSCgpdP/SP1XUCZZN/cAwDr9J27u3hbZyUxvljt3BMCZHmzTpd0QV0bB1cqVdFgl8r1MWmfH7UPkPZq5G2SLjKlWyYV1Bny7ioTDZ9a0tYFo0aVVX3mZT8YahfGGdNcI0a2y2v5rR2Q//H/EU2oWk+rBkR2RDeq8lDwto1myB3M5HTP7it3hesDm99vHUtWHz2n2VKv4Q4O3O2jjAJiuJUqYaCCLIdo0fHDM/dFr/tAaBy30Q6tJz0fcYSUXI8mhoAxW/AWT/oJ1y9vKLuEWj5f8/2i42oUMG6NlN/UzLWMOBw3vS/ecrqYiEobhSloI9qEMgg2SNdaAJXIWgEP2QA8Ev5ZO4piJzUKTZcua59IhWs2zPvSJydJocUe7HdqVKGsdBiuUkwwPb1YyCR9TYWE9OrWora9hpg0mrQsWDgwKLvGk2X3utxRuNVkTTdirRufduCj547YWj/gaQCGXx+o44FtvU= Received: from toaster.lan ([2a01:e0a:3c5:5fb1:af6b:4350:776e:dcda]) by smtp.googlemail.com with ESMTPSA id r3-20020adfca83000000b0033cdbe335bcsm2415244wrh.71.2024.02.13.13.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:58:16 -0800 (PST) From: Jerome Brunet To: Mark Brown Cc: Jerome Brunet , Arnd Bergmann , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v2 1/2] ASoC: meson: aiu: fix function pointer type mismatch Date: Tue, 13 Feb 2024 22:58:03 +0100 Message-ID: <20240213215807.3326688-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213215807.3326688-1-jbrunet@baylibre.com> References: <20240213215807.3326688-1-jbrunet@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Bot: notify X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790823390639108759 X-GMAIL-MSGID: 1790823467468279441 clang-16 warns about casting functions to incompatible types, as is done here to call clk_disable_unprepare: sound/soc/meson/aiu.c:243:12: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 243 | (void(*)(void *))clk_disable_unprepare, The pattern of getting, enabling and setting a disable callback for a clock can be replaced with devm_clk_get_enabled(), which also fixes this warning. Fixes: 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support") Reported-by: Arnd Bergmann Signed-off-by: Jerome Brunet Reviewed-by: Justin Stitt --- sound/soc/meson/aiu.c | 19 ++++--------------- sound/soc/meson/aiu.h | 1 - 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c index 7109b81cc3d0..5d1419ed7a62 100644 --- a/sound/soc/meson/aiu.c +++ b/sound/soc/meson/aiu.c @@ -212,11 +212,12 @@ static const char * const aiu_spdif_ids[] = { static int aiu_clk_get(struct device *dev) { struct aiu *aiu = dev_get_drvdata(dev); + struct clk *pclk; int ret; - aiu->pclk = devm_clk_get(dev, "pclk"); - if (IS_ERR(aiu->pclk)) - return dev_err_probe(dev, PTR_ERR(aiu->pclk), "Can't get the aiu pclk\n"); + pclk = devm_clk_get_enabled(dev, "pclk"); + if (IS_ERR(pclk)) + return dev_err_probe(dev, PTR_ERR(pclk), "Can't get the aiu pclk\n"); aiu->spdif_mclk = devm_clk_get(dev, "spdif_mclk"); if (IS_ERR(aiu->spdif_mclk)) @@ -233,18 +234,6 @@ static int aiu_clk_get(struct device *dev) if (ret) return dev_err_probe(dev, ret, "Can't get the spdif clocks\n"); - ret = clk_prepare_enable(aiu->pclk); - if (ret) { - dev_err(dev, "peripheral clock enable failed\n"); - return ret; - } - - ret = devm_add_action_or_reset(dev, - (void(*)(void *))clk_disable_unprepare, - aiu->pclk); - if (ret) - dev_err(dev, "failed to add reset action on pclk"); - return ret; } diff --git a/sound/soc/meson/aiu.h b/sound/soc/meson/aiu.h index 393b6c2307e4..0f94c8bf6081 100644 --- a/sound/soc/meson/aiu.h +++ b/sound/soc/meson/aiu.h @@ -33,7 +33,6 @@ struct aiu_platform_data { }; struct aiu { - struct clk *pclk; struct clk *spdif_mclk; struct aiu_interface i2s; struct aiu_interface spdif; From patchwork Tue Feb 13 21:58:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 200694 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp836886dyb; Tue, 13 Feb 2024 14:13:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWOOA/tcysJWCrMJloD3lEzwlYbTWrbzLvKDbXj0rtCz7MaKe6ogfxI47VVXeqjbcI6iZGiQYOmV/kWyXwjHETEeGzvHw== X-Google-Smtp-Source: AGHT+IFgtxCygokwa18MQGEMNP4JmuaF4gzgELRQ5kIhRkyNisFVx6fUNdgg+eyj52eLGLB+ENOz X-Received: by 2002:a17:90a:f491:b0:295:c105:cb78 with SMTP id bx17-20020a17090af49100b00295c105cb78mr787078pjb.4.1707862385714; Tue, 13 Feb 2024 14:13:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707862385; cv=pass; d=google.com; s=arc-20160816; b=rIHS8z8CZjgTSvs1rXPVem/x2VaVuOzMwn2B+Io2Hfy7Oco7gXE7TkNIqlFmWXFHFw /ltrew+M9pGYy0HAkPo7bXLI8p/1qqFkbqTbHFl4nyZ2SLS7m27sxVAsLThZSZ9IuXOK jtUa3OFr7Mq8QI4lfM9ZvVUy+0+cAtknU5wCQzpMbZoQmojzMpZSAC0yKzizyAQjvQa+ niYhr5hcZ813eI2VWyG+JT3VgNWznmrbuYWgehC2BRci4luVog84Qz0yYxfOx8A5T/pI 5XdRtSczFKvIH+a+xH01+HERmJxFVO6oDl6XLHDlyjECAm29a4bj54yUDyIIO+Jdnv8D Hxag== 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:dkim-signature; bh=QhlnphO38kFK64rZw6/MYfY4vE6pLo1I8JNTrKfTc6I=; fh=dY190ByAAJe2KGG3JFqkUc68HBcANHK9A+8DGi+NEcQ=; b=RxL7pZmEnE3f4E4JpR2q0le3yJO6qY9OkrPJUgG/7jo9JTryouDBPV3IWP6gJ+Eks7 rlDHUIk2h+ucR/75cQlnz3ilbbA7bCLySArwW5noASZgmi68DoQEalmj7AmhxEYI9u7B DE8pBJ1zzxHPYmDILpOjzsSek6F75j8159IorwYiSCv1fJ4kXNNwHdUjoYOVkS5adbnq SeTgHbKYmU/XNCf0db7Fn64LB0Tc5IAkcZh5VD3l4+zFOrQzh++Bmp+xWESkdjXxWjdD uYusRuhye6AK7Ci1XVUERZ0eSkwM25pZnGJjqG3+0sgTpdu7iqhjQCIlB4+WCnFCfuNb 0OAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=BmWQ659L; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-64405-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64405-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCURAjWT0gHWzsSVfS46VoN9ZwlNSlOePqOpTihk76ges4o8e6SS5NvPvn334KWmXznsbQaA6DhPXenMPy7j7j1uARRTOw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ls11-20020a17090b350b00b002989b28e4dfsi29189pjb.6.2024.02.13.14.13.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 14:13:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64405-ouuuleilei=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=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=BmWQ659L; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-64405-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64405-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1D8EF291E42 for ; Tue, 13 Feb 2024 22:03:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0171D679E2; Tue, 13 Feb 2024 21:58:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="BmWQ659L" Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 B62FF63115 for ; Tue, 13 Feb 2024 21:58:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707861503; cv=none; b=QF6jW1zpG1qfEYNb73XMPSw1qZkXJw4wDcW9jgkFLhAG1tQ0dAYndu6ZRJ/7S0GVF1XZKvNklVSDkq8l6Aa9Do8l3bgIoud/R1s6SIg+dMCaqUmF2Wgrv+l2uDZKd799Jr/5b/3p1kzqTHC7+D17QSMd8BpH7qJyIx/qIT5nJxc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707861503; c=relaxed/simple; bh=jfZkHq9HMbZcPnc0fldRolB1xckrU5dTpOn3zFrSjtk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AzcgksN4wCi5mshlhofVBmadaBjsKetxP72b4Io1ZfqH6a9k4OmjPpCnNtcRL4fYB6VsgeLD8D6upbBkKqEYz9r89VVuMIGntcS86ZfuFBUed3SEMGhy0ysZJ0V1Zsq7+zHal8HYn9KLm4L0men/wM0ZHhrQ3jBBMElRaIKx+7g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=BmWQ659L; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-33ce58eebe4so129400f8f.1 for ; Tue, 13 Feb 2024 13:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1707861498; x=1708466298; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QhlnphO38kFK64rZw6/MYfY4vE6pLo1I8JNTrKfTc6I=; b=BmWQ659LSRlnERUOvz0ZO6omAKBtcF7GLPQuL6lTdp6dtpuJcYeBCAq4Ph1CT7r64n ZT91gnTnq9B/DZrZPkEII/3jqJOXC9Iz68a+Kc0zn9XyqNJQv4vkxVHywa+Z/SHgpQgH e0dJ+Rij9JCGcKwF1o1XJUYyo2CBtHgtmkgdhVuC460zO1WbRJjRkhTuNDmIYyzFcF0h HB2MqpMifV8NmUT82aWirVt51ovy4v8WOFsQm+Q0+x9wb4tnFtF3Epyf6MSd+46hpcqC bBwkzdYDrb6Xw8nDVmaHWAcudF0k5EggbEKieCaTES8WY82KQ0cjT0899RpWAzeTr7l8 Uz5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707861498; x=1708466298; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QhlnphO38kFK64rZw6/MYfY4vE6pLo1I8JNTrKfTc6I=; b=ciFNTeHG5Tg6ulwXZpBk42QGGMaER6QFCoW+KlbP9AWGo/1NpMviLxqdVbmD+zmMnt QH9DGy3KFXX2I3FCQXFD4s3TvYtP8rsiscupWqV1FplnVNbgk61Pt4TOozanEMRKjTpu iI/Lj+mpExJL/tjHiPW+KLRM3VsMrhGUttO/L6j2JHmhA7pZCa7AN1vyGopvqYsHcCna bXLduNK3nSfAjp9Vj6gcMP1Vn9C/gzFK2XFcWx43IOcCbuMdOdT6QTnIVSaKFMtwsptF JUCbavYEAhtMM+kIc+0ZLsWHNJIAexTB1+YmqdqUGKiiXQR53M0b0D3lfbm7gPvYEjBO CnJg== X-Forwarded-Encrypted: i=1; AJvYcCU+JBGTavlNi2MQ0xMNVM8BZ4kzlwJmIB7PggX0tCdsiHPa054GWEHoI6wFZ1YdhG4ScWIBZ8E1eZNj/IekaaD9sDfBvOg0RX85H+7V X-Gm-Message-State: AOJu0YzpkQ9GGAGXIJzMuTBDjRM5gyqBfm1NHI+4ZdpQx9CpFsxHIOTy J1f0UHcRFxJbFertELOlU+pAtmSlegRMpXRq0Eby9Rv/zaAyQfzmoivSs7emETc= X-Received: by 2002:a05:6000:8c:b0:33b:eef:86bf with SMTP id m12-20020a056000008c00b0033b0eef86bfmr388447wrx.25.1707861498107; Tue, 13 Feb 2024 13:58:18 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVJ0VVy771lMRNflwR2yXi3R6/+dub54OOGnNJcvbuYIcEQsS5QlZrroSyMaWyijwq5c2hC2NvAD1pLPuWErPD4resXTwAhLmgxRmddslpV+8WAJTZhqazEat8FROH6ieAWumwv9lwt2Yn+FPrC6KmppIxwT/69asnfrePkZYVyJm3MK8h6ONvWc4IVBliqIFds5PZnsuGbkN5YWb7v+EZ3lPaVlx8GQXS98E5BHdIkhe2fksr9g6fEQtBkmWZfjgIWHMdjABQC/Deor8k9BzNBZ/jZxeieUroSwXKpwXdAHo9GV7XRnDmuBhbRO+C92L59xtUs95jer13d1n3ZBFTan8/bDFyhPVJtW6W85pRJdzcG8SMhFTgzPnvTI9XyGvrfPCYEwTn2530CpHXZlnm58uKPeqEc/f4S8CjWah4EKiga/vB75UKu5a61ol+z+cTSNM2/+4nM0LDdsn3Xe02hOUew7hU8xN0JxTWaapP3O2LfNImUG8yZiMxgbypKxrbgjYv0pwfGsy5NiexdQymHchYp1g1/WlBYRa30jRBImDVuDC3qnO+VtTeO4PfPh4VlA4esexQfeGrSzLs05LRvxWwnxHyNEIOclcbc1msQ1BOqA/4= Received: from toaster.lan ([2a01:e0a:3c5:5fb1:af6b:4350:776e:dcda]) by smtp.googlemail.com with ESMTPSA id r3-20020adfca83000000b0033cdbe335bcsm2415244wrh.71.2024.02.13.13.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:58:17 -0800 (PST) From: Jerome Brunet To: Mark Brown Cc: Jerome Brunet , Arnd Bergmann , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v2 2/2] ASoC: meson: t9015: fix function pointer type mismatch Date: Tue, 13 Feb 2024 22:58:04 +0100 Message-ID: <20240213215807.3326688-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213215807.3326688-1-jbrunet@baylibre.com> References: <20240213215807.3326688-1-jbrunet@baylibre.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Bot: notify X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790823509256876206 X-GMAIL-MSGID: 1790823509256876206 clang-16 warns about casting functions to incompatible types, as is done here to call clk_disable_unprepare: sound/soc/meson/t9015.c:274:4: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 274 | (void(*)(void *))clk_disable_unprepare, The pattern of getting, enabling and setting a disable callback for a clock can be replaced with devm_clk_get_enabled(), which also fixes this warning. Fixes: 33901f5b9b16 ("ASoC: meson: add t9015 internal DAC driver") Reported-by: Arnd Bergmann Signed-off-by: Jerome Brunet Reviewed-by: Justin Stitt --- sound/soc/meson/t9015.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c index 9c6b4dac6893..571f65788c59 100644 --- a/sound/soc/meson/t9015.c +++ b/sound/soc/meson/t9015.c @@ -48,7 +48,6 @@ #define POWER_CFG 0x10 struct t9015 { - struct clk *pclk; struct regulator *avdd; }; @@ -249,6 +248,7 @@ static int t9015_probe(struct platform_device *pdev) struct t9015 *priv; void __iomem *regs; struct regmap *regmap; + struct clk *pclk; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -256,26 +256,14 @@ static int t9015_probe(struct platform_device *pdev) return -ENOMEM; platform_set_drvdata(pdev, priv); - priv->pclk = devm_clk_get(dev, "pclk"); - if (IS_ERR(priv->pclk)) - return dev_err_probe(dev, PTR_ERR(priv->pclk), "failed to get core clock\n"); + pclk = devm_clk_get_enabled(dev, "pclk"); + if (IS_ERR(pclk)) + return dev_err_probe(dev, PTR_ERR(pclk), "failed to get core clock\n"); priv->avdd = devm_regulator_get(dev, "AVDD"); if (IS_ERR(priv->avdd)) return dev_err_probe(dev, PTR_ERR(priv->avdd), "failed to AVDD\n"); - ret = clk_prepare_enable(priv->pclk); - if (ret) { - dev_err(dev, "core clock enable failed\n"); - return ret; - } - - ret = devm_add_action_or_reset(dev, - (void(*)(void *))clk_disable_unprepare, - priv->pclk); - if (ret) - return ret; - ret = device_reset(dev); if (ret) { dev_err(dev, "reset failed\n");