From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932635AbcHVQEZ (ORCPT ); Mon, 22 Aug 2016 12:04:25 -0400 Received: from down.free-electrons.com ([37.187.137.238]:56977 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754844AbcHVQEY (ORCPT ); Mon, 22 Aug 2016 12:04:24 -0400 Date: Mon, 22 Aug 2016 18:04:21 +0200 From: Maxime Ripard To: Chen-Yu Tsai Cc: Icenowy Zheng , "codekipper@gmail.com" , "alsa-devel@alsa-project.org" , "lgirdwood@gmail.com" , "linux-kernel@vger.kernel.org" , "be17068@iperbole.bo.it" , "linux-sunxi@googlegroups.com" , "broonie@kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [linux-sunxi] Re: [PATCH 2/2] ASoC: sunxi: compatibility for sun6i to SPDIF Message-ID: <20160822160421.GR7104@lukather> References: <20160730142716.29377-1-codekipper@gmail.com> <20160730142716.29377-3-codekipper@gmail.com> <170941469890365@web9j.yandex.ru> <20160730152049.GU6215@lukather> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kJZGYML2m3vFaueA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --kJZGYML2m3vFaueA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Aug 01, 2016 at 09:39:34PM +0800, Chen-Yu Tsai wrote: > Hi, >=20 > On Sat, Jul 30, 2016 at 11:20 PM, maxime.ripard@free-electrons.com > wrote: > > On Sat, Jul 30, 2016 at 10:52:45PM +0800, Icenowy Zheng wrote: > >> > + if (of_device_is_compatible(pdev->dev.of_node, > >> > + "allwinner,sun6i-a31-spdif")) { > >> > + host->rst =3D devm_reset_control_get_optional(&pdev->dev, NULL); > >> > + if (IS_ERR(host->rst) && PTR_ERR(host->rst) =3D=3D -EPROBE_DEFER) { > >> > + ret =3D -EPROBE_DEFER; > >> > + dev_err(&pdev->dev, "Failed to get reset: %d\n", ret); > >> > + goto err_disable_apb_clk; > >> > + } > >> > + if (!IS_ERR(host->rst)) > >> > + reset_control_deassert(host->rst); > >> > + } > >> > + > >> I think you do not need the compatible. > >> You can just detect whether the reset is present. > > > > That would weaken the error check. If we're running on the A31 and are > > missing our reset property, it would go unnoticed. >=20 > We've been doing it this way with the mmc controller and the usb hosts th= ough. > IIRC you once said in the older SoCs, the reset control is tied to the cl= ock > gate in the hardware. >=20 > The _optional variant is also funny, though I understand it is a design > of the reset controller framework. Yes, I know. But that doesn't prevent that design from being better. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --kJZGYML2m3vFaueA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXuyKFAAoJEBx+YmzsjxAgQCIP/2hZXAVmspH8pq9LmCs0TW58 /ZGthgTmXgcCDdBf/qT9pLJjp0SFYe68PtrihfoCklUDxKU/X0asH3N0n0wOeH6m 95Qg+ewiz3gUvXYyHCVQT0zqpyLyXvioeCYR8lVWy8nTS8uhS5OxWUWENMrtagUZ mgG6PHO4a3a5iemQI7tLd4iZMyTWgJVR3vbtELpRm4r+4p3oBurq5LNQJV+HPkc8 pjru0iKBRRy2G8NN/bRjQ2m4xylQKr6I3UMwvlMs7K+CsQgcrKy6oV0W4QuCV0fd 5Hw7mdbO89eehfTid2KM7+Yn2cbaj9nb6VgsB1Mi38PyPmF2WoSH7gVno5OWSuxP SkaaF8FCOxeXVsEwoXo5jYy9cROMlIKhv4KrFRSjg9Rdn16Fwr08pXy98+UXkaxE 6fHBJCrc0NQ0bUB1/9aKNhnPWSNzqpqjcCgfd5xZ85MXKDcJS0nynddOGch6ABH2 E7D1n1sLW/JXHyNBD5b+TJbUmGhhIXqvFBMiW2KJ6X9DwlXGmnC65EnKv3RS3oSA xME8tVkEhVskwIs+vYGYObJsed2mSgvVVBZIrRcG+vLAWY+c1igovdx/E7+mYQvf BUOLva4iXvK42ufi7ZBCz/MUAQ3i5uN847pwooh0a2Hz7OSNCcGBqQZV8sQJ6w4G UeJxPIMPR35LP9GzdaD/ =D/pY -----END PGP SIGNATURE----- --kJZGYML2m3vFaueA--