Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3434264imu; Mon, 28 Jan 2019 04:56:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN4TXOydf1ualunf7floh6vMljiGlBaSvX5cvLz2/ezHRSZCL2EZ512WjbR4O5UDma1gASag X-Received: by 2002:a17:902:b707:: with SMTP id d7mr20725905pls.29.1548680171721; Mon, 28 Jan 2019 04:56:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548680171; cv=none; d=google.com; s=arc-20160816; b=H2LAHys2MAz+sH6rXg4p0nGcA9aj3QdVVUEmoi52G4P5JfnQGNJ8MH9q57O0YbK+HQ 6XeuoBCLMCX2QMybIPjBXpHfPjKtdS2T9+rSRKkMESks/hbWYdoTYLK3cLQ5P/XAIj8o Rxd2DqvU8hrwq+EWMOx9gBiot2Vh+lQwb1Ri4ztWxC+UY3c57iQEVaK9WemPjZ8+1Dg8 BJN2/7isIinLFGJBFOjABLLo2/eoGVs68Wd5KE+T7PnkOlY8UDewC+N/ozmx0y92POG1 jJUUhS7edHIvmhcdnLG5z8EpNJ950V0Yf8pUbGKX0a9rekmYF2f2c279PSWnPn1jsbvS wBnw== 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=ty+oDqCF72Ap8JwvZRllH7Lg7RZJslz8F/8pyO958aU=; b=Rf0DjopkXmBzPmzIYdhFJVR3vRu9wnY4PSgnoChTKW3TzFV7ZRTVPUnEA0OeX1Q4Ns Zvj/rOY0oRXzn3lP8G8d0BH+boPEh/vz9/aJUt4eemm8hKbUSLsUki0772EFeUe9f30W mzY0GHuAPAypKPmbzUNi0j+svUEp2cy9RWN48fBUqd8/HjrPFRsW0SLWiGnlEhY67or1 ewWZX/130SMMcT8FZepQWnQT53595tUB18CjiZ3IaOu2+zedLOEoqVVCdGjQQIbBxXJi LhccYo84HWFJVjLI/ytvKDGDk/tW91hCD1iqxuG804U5gXMvj+B49V2jL/D3I3f4JiOk NpVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=BFuvZ8YD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15si30464174pgv.351.2019.01.28.04.55.55; Mon, 28 Jan 2019 04:56:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=BFuvZ8YD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726762AbfA1MzW (ORCPT + 99 others); Mon, 28 Jan 2019 07:55:22 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:33800 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726611AbfA1MzW (ORCPT ); Mon, 28 Jan 2019 07:55:22 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0SCSYxo026326; Mon, 28 Jan 2019 12:54:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=ty+oDqCF72Ap8JwvZRllH7Lg7RZJslz8F/8pyO958aU=; b=BFuvZ8YD3NGfXoSw1YzJwi7TCjDxCP067fqOulXvovAVfM5TTskWlfU/YSI2OK6mBVvB zWzw/aq2mwPpQolkOUQ6ybvDm+Pm22dpxTFLZyT5MTmSn82wbdnmKbhjNb9c+wiSj9w7 5xb1IADw7B2FiSlBRAec5LeeOnz8zKyxxaR3n6vx6WWizZDbjw9yMMq3DS47k+AurpDb yDH5qPgOsqjXwcQsJr3jzBKnmfxePdn4bfjfqcOJS099oX0ZYKb4NKDuW2/kUKmQds0P mHIhIe1uc5uB+UD8fWJeR9/Wx3zMUFt5zGKM7p1BCtajmy1r6Wlh5pe1hDZhpiNSL5Oe 5A== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2q8d2dx3b9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Jan 2019 12:54:46 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x0SCsebZ028645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Jan 2019 12:54:40 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x0SCsdRP023335; Mon, 28 Jan 2019 12:54:39 GMT Received: from kadam (/197.157.34.178) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 28 Jan 2019 04:54:39 -0800 Date: Mon, 28 Jan 2019 15:54:26 +0300 From: Dan Carpenter To: Renato Lui Geh Cc: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, stefan.popa@analog.com, alexandru.Ardelean@analog.com, giuliano.belinassi@usp.br, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: Re: [PATCH v2 2/2] staging: iio: ad7780: moving ad7780 out of staging Message-ID: <20190128125426.GG1795@kadam> References: <20190127203344.ofryhhrae2wjn6j2@renatolg> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190127203344.ofryhhrae2wjn6j2@renatolg> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9149 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=608 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901280100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 27, 2019 at 06:33:52PM -0200, Renato Lui Geh wrote: > + st->reg = devm_regulator_get(&spi->dev, "avdd"); > + if (IS_ERR(st->reg)) > + return PTR_ERR(st->reg); > + > + ret = regulator_enable(st->reg); > + if (ret) { > + dev_err(&spi->dev, "Failed to enable specified AVdd supply\n"); > + goto error_disable_reg; > + } We don't need to disable the regulator if enabling it failed (probably, I haven't looked at the code). > + > + ret = ad_sd_setup_buffer_and_trigger(indio_dev); > + if (ret) > + goto error_disable_reg; > + > + ret = iio_device_register(indio_dev); > + if (ret) > + goto error_cleanup_buffer_and_trigger; > + > + return 0; > + > +error_cleanup_buffer_and_trigger: > + ad_sd_cleanup_buffer_and_trigger(indio_dev); > +error_disable_reg: > + regulator_disable(st->reg); > + Well chosen label names, btw. Very easy to review. > + return ret; > +} > + regards, dan carpenter