Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1240798ybh; Thu, 23 Jul 2020 04:08:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX5JzaCRTbkkK0FvjOzv8o/i4XtncNiHf8E676TBshZFs7LY85+2YJtAQ/qMzIIbLB19Cy X-Received: by 2002:aa7:d802:: with SMTP id v2mr3618579edq.77.1595502523958; Thu, 23 Jul 2020 04:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595502523; cv=none; d=google.com; s=arc-20160816; b=d+qTOnNLduyXHubPsl3/NLNFNKTT1erI8E2LFYaeKfpk+02XUPwK1EIcjndcPQX530 3q8SIsVvp6MG6EKf1rV6dfv4ug30KEYZHMB1uYn29UnM7CA2Gi0oUVemVnaM5bd47M6B DtE+Nh0OChKc0b3pXpNKIl7WQUc26eABI+iSJ4SgRGrH5/ij0KeU/0uG4rAoGM8zCZZH MxCwuo0lELwN8i8aBocIAhQhJUpXnoMPjo3fp4DYVr51rb+yt+3m+Eb00+zCCWWXic5N B1oOkumm0cu+AkKp2PZHjFlrKvIbKWLKXNeALIhWOPAJaRnGsQmLcpHrYryRr2lvPWQM WL6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OqQhHO2GM9jru25lZzH5wkJ17Xkj5uwsYB3cuEx/I4A=; b=ZRPTDyE61Necnj3LHN63ziGMoaP0mRLLl1Egz6bI3SfKYOb0zfkDh1fb25xXGGUaze 2J4nfzaS89VU684DltjXnWcj+UTE/vKg8WKs74kBD1QvvDMfutLu6+FZBaDOy8Cv5Qs/ Yv0Y9f/pIo3GzaYu3viq1E3pKnuKhiNNTKEwV8PYGPcu17FVxfhCiB2XptVErfpj4iiH S+cvkyjvK1Gy6W2sOq+UktP3a9AsUm4aygTYXaqu4bvNJd9v2fUFjqJu37/keJPq+59s ILlNkcS/x80f1hHCNQ2olDvOb0rgwHKzZzjfmY+4fSs1tGbrGwS/Ahqb9hlTuq9XeR+7 UHzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eI1p89Pt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lc15si1754742ejb.526.2020.07.23.04.08.21; Thu, 23 Jul 2020 04:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eI1p89Pt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728342AbgGWLFj (ORCPT + 99 others); Thu, 23 Jul 2020 07:05:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:51294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727859AbgGWLFj (ORCPT ); Thu, 23 Jul 2020 07:05:39 -0400 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 24E75206D7; Thu, 23 Jul 2020 11:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595502338; bh=cDmd+AClrTIXXvkMIxqlnPN85VW8f4Ew+hvTI4Dl0YM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eI1p89PtcGu3MfxPsU3nMkAU3wyuB88VjWAtDh49sWjehzT6n+lmak60sBC2zxI3Q AhlS/vADDJRlX3c72RLDz6kDNXRMHyNaQEc3loIaAEsbiBTCr22H7ASuR7k+K46dxR zQPSN09nPBlOfNHOspFPYhRhgYL8wdKBc8JrAyYk= Date: Thu, 23 Jul 2020 12:05:23 +0100 From: Mark Brown To: Vincent Whitchurch Cc: Mike Looijmans , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, balbi@kernel.org, gregkh@linuxfoundation.org, lgirdwood@gmail.com Subject: Re: [PATCH v3] usb: dwc3: Add support for VBUS power control Message-ID: <20200723110523.GA4759@sirena.org.uk> References: <20200619142512.19824-1-mike.looijmans@topic.nl> <20200723075612.tn5dbkhes2chohwh@axis.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AqsLC8rIMeq19msA" Content-Disposition: inline In-Reply-To: <20200723075612.tn5dbkhes2chohwh@axis.com> X-Cookie: Down with categorical imperative! User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 23, 2020 at 09:56:14AM +0200, Vincent Whitchurch wrote: > On Fri, Jun 19, 2020 at 04:25:12PM +0200, Mike Looijmans wrote: > > +void dwc3_set_vbus(struct dwc3 *dwc, bool enable) > > +{ > > + int ret; > > + > > + if (enable !=3D dwc->vbus_reg_enabled) { > > + if (enable) > > + ret =3D regulator_enable(dwc->vbus_reg); > > + else > > + ret =3D regulator_disable(dwc->vbus_reg); =20 > dwc->vbus_reg is set to NULL when the regulator is not present. These > regulator_* functions expect a non-NULL pointer so a NULL check is > required before calling them. Does the device actually support running without power so that's a thing that can happen? _get_optional() should only ever be used for supplies that may be physically absent. --AqsLC8rIMeq19msA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl8ZbusACgkQJNaLcl1U h9A0nwf+IJuuTu/qlJsYFuUJQPV3t/N46dHV6PYxmEqbAuqbolii0elI2nQniu4X nwgotmRkWYCkBZXMaO9TCifxNsrY+sL5zmuMBORCVAXnHarhx/CV6W3sEqe3+4eJ CUeY6BeuOONdHbgItrnqG1aJ/MzFPHajuOWQNBKrwZgXWWT9B0sVru59Kw2MFBwD FGfRAFMcMW890e4/H4MIzD9lIMINZkz2Dj1xDaxgmVAcpxItwbdfOLdVUiJu9QTP UfEEZLdJaIeB3mbgl9TDBG9RB5Q9dq/X0IcGqX2X9WP4DI+DND0TUZFz7kwwo9pC b9yadDCwFqRaBP2zQQadLc4c4XcEoA== =mOZg -----END PGP SIGNATURE----- --AqsLC8rIMeq19msA--