Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2834608ybb; Mon, 30 Mar 2020 14:02:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuNIdjazZ+mfKiUVFt597cqtESjJBl9ENs5ke5NRpKYGuiWf8DgsGq2FJu1gVKZ2zVnFdM8 X-Received: by 2002:aca:724f:: with SMTP id p76mr16745oic.112.1585602150988; Mon, 30 Mar 2020 14:02:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t8si5620094ood.64.2020.03.30.14.02.17; Mon, 30 Mar 2020 14:02:30 -0700 (PDT) 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=fail header.i=@nio365.onmicrosoft.com header.s=selector2-nio365-onmicrosoft-com header.b=RNQakyY9; arc=fail (signature failed); 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=fail (p=NONE sp=NONE dis=NONE) header.from=ni.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728879AbgC3VBd (ORCPT + 99 others); Mon, 30 Mar 2020 17:01:33 -0400 Received: from mx0a-00010702.pphosted.com ([148.163.156.75]:24098 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728165AbgC3VBd (ORCPT ); Mon, 30 Mar 2020 17:01:33 -0400 X-Greylist: delayed 2903 seconds by postgrey-1.27 at vger.kernel.org; Mon, 30 Mar 2020 17:01:33 EDT Received: from pps.filterd (m0098781.ppops.net [127.0.0.1]) by mx0a-00010702.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02UK84VV019464; Mon, 30 Mar 2020 15:12:47 -0500 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by mx0a-00010702.pphosted.com with ESMTP id 3022m1dn8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Mar 2020 15:12:47 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kRwVVwsohTXsODP7kx8fP7yYq6Wmt247VRXKLfOkoOUuE3ovGD8Oozl6tbUz/xj8zorwSIPsK9/rZiGU1s1EzYw632r7Af98l6bbXxe2Ep/U9qoiGS1q75v2sLIHglNvSzJFgoVID5QCeIqm4xAPyqqhF6xMVb7FIUhSljWqfzAKr2AIca+VysT+PFDgcxSS5IWpMhaldGt8sT+V952Oj8RgKzIwtKlr2zriYveLgTXmDV0Jnay/3f+q3SM+5kX7gaBWvnydzg4Izgfd5LHEamtq5ZitskpEK/yjV8IiR2P2mfx1D9Njqq0mfWQ5gOEOkgovJWymGJmis/ThYbDioQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cUfw/vCyDAf3Te6MwylHE3EgpEc1Rc+AZWC/FpLqct4=; b=Umn8rSgy9/4Qk+zJ/DcM1EUin5nehxBm4lLJVIK78Bw03IND9JELDGeKfx9F11+KpLd4s/CrqOE06cXOJ5YVHjBBXbqrNwTy22yuELEV20LQRMcbGL/TLmiIlpcm3QdP7hbVDObbKGiNlhUuuHekW0QIUrCdBY6U3ag+oPgijMMnvc/J87FEN/nKXQCzWuteO14QFfJpjicR7zr8VUNl3yP5LMeJ9J+dQUy+qvi6MkmIJDWY5LIdi/Pmi6xpnIb0fiEdzFMQeXtzCXuDxf2LNcsg4l5kfJkM3HqzzDnUfN0GyxAdnjq4/SBI9CJ/jfnriCbOXuaiq+/6y116zBuTKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ni.com; dmarc=pass action=none header.from=ni.com; dkim=pass header.d=ni.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nio365.onmicrosoft.com; s=selector2-nio365-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cUfw/vCyDAf3Te6MwylHE3EgpEc1Rc+AZWC/FpLqct4=; b=RNQakyY9NR74tg3YU4i1ZImXG4uTVmSOILMvRb4CWIK6T8hdCtay86qbO+AsBP4rldtzz2QN+PqNIFkE51qFR4ySo665h6JYsdfb4cYmlhG10jOcVXR+z1H2bwgRFSiBQT++cyCRWSs92/BRbdRdsn28PJL6XhYxoboe/qpV/J8= Received: from SN4PR0401MB3646.namprd04.prod.outlook.com (2603:10b6:803:4b::29) by SN4PR0401MB3645.namprd04.prod.outlook.com (2603:10b6:803:45::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Mon, 30 Mar 2020 20:12:44 +0000 Received: from SN4PR0401MB3646.namprd04.prod.outlook.com ([fe80::d05b:1953:4111:38e4]) by SN4PR0401MB3646.namprd04.prod.outlook.com ([fe80::d05b:1953:4111:38e4%5]) with mapi id 15.20.2856.019; Mon, 30 Mar 2020 20:12:44 +0000 Date: Mon, 30 Mar 2020 15:12:43 -0500 From: Michael Auchter To: Andy Shevchenko Cc: Lars-Peter Clausen , Michael Hennerich , Stefan Popa , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Liam Girdwood , Mark Brown , Linux Kernel Mailing List , linux-iio Message-ID: <20200330201243.GA22106@xaphan> References: <20200317135649.8876-1-michael.auchter@ni.com> <20200317145113.12413-1-michael.auchter@ni.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: DM6PR17CA0008.namprd17.prod.outlook.com (2603:10b6:5:1b3::21) To SN4PR0401MB3646.namprd04.prod.outlook.com (2603:10b6:803:4b::29) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (66.90.216.181) by DM6PR17CA0008.namprd17.prod.outlook.com (2603:10b6:5:1b3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.19 via Frontend Transport; Mon, 30 Mar 2020 20:12:44 +0000 X-Originating-IP: [66.90.216.181] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c13d9d8c-3684-4ef0-f62e-08d7d4e6b53e X-MS-TrafficTypeDiagnostic: SN4PR0401MB3645: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-Forefront-PRVS: 0358535363 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN4PR0401MB3646.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10019020)(7916004)(4636009)(366004)(136003)(39860400002)(396003)(346002)(376002)(186003)(5660300002)(6486002)(2906002)(1076003)(9686003)(8676002)(52116002)(81166006)(86362001)(54906003)(66476007)(66556008)(956004)(316002)(16526019)(66946007)(478600001)(6916009)(4326008)(81156014)(53546011)(8936002)(6496006)(33656002)(44832011)(7416002)(26005)(33716001);DIR:OUT;SFP:1102; Received-SPF: None (protection.outlook.com: ni.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n0hKGSbrryno2PpC4j4L5CmiMHcMP/IP+pkgN3CNC+rUhtQfOUP9j4pYMrcgKzwHRAbLxJqZIqmR5EP+Bu+krP6yDMjjTFNbb5x4rUvSyFERAMUTTf2wnRbma1TaZV4mWLOiPRWonpzOUtDx5RBeD2Wf9VuCO0svxjrtIqIjquKzdvT2t/TR9U5yxyQYZYnOVaNGHqgPMbY5ro2KukX6WJSqFMqd8tJvYJJlLxThcIElD7xzd/p9IqikQuM14hhIaLgnQumGPzQz/YylpYNLnHtXMvRk1E2MDCaysMYxUD+CIseqJ2u7rCJWPlC6Gje9i5X4Jb9wH/z0F8nx1k4tjbDPEFnipQrLca3hTwmMBmwqIUd7JwGFYTeRLfoaZ8PDRBCvWhc1h2l9x3O6fGBQRoYfYw3WHqEfcKzdyAUinRGfuxyvo+RR8qb2V+wSniia X-MS-Exchange-AntiSpam-MessageData: +nztp3rKfXZJqFzWjJCq6abq149HqJopeY3yYC8Ce2odvgHKYN9xE0n38hkDlUDZ/JopQdF1dk0OqKoEN7IvMPlW1jfPNmx2M/ikgwpWciNjwq22uZzGwENDCXoIX7tUPIoSkdGuR6HRaiNQoIrqNw== X-OriginatorOrg: ni.com X-MS-Exchange-CrossTenant-Network-Message-Id: c13d9d8c-3684-4ef0-f62e-08d7d4e6b53e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2020 20:12:44.7521 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 87ba1f9a-44cd-43a6-b008-6fdb45a5204e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4PAIJ7XlXnpEx/Z7b2NYyUNNcBElSabi6hK4wsF5fefcN7H6p+fuS/pCDXr7vr2fH7PK+mx6Dew/+gkU2PCQqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0401MB3645 Subject: Re: Re: [PATCH v2 1/2] iio: adc: ad7291: convert to device tree X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-03-30_07:2020-03-30,2020-03-30 signatures=0 X-Proofpoint-Spam-Details: rule=inbound_policy_notspam policy=inbound_policy score=30 malwarescore=0 impostorscore=0 mlxscore=0 mlxlogscore=999 clxscore=1011 lowpriorityscore=0 suspectscore=1 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 phishscore=0 classifier=spam adjust=30 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003300171 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andy, Thanks for the review! On Sun, Mar 22, 2020 at 01:46:21AM +0200, Andy Shevchenko wrote: > On Tue, Mar 17, 2020 at 4:53 PM Michael Auchter wrote: > > > > There are no in-tree users of the platform data for this driver, so > > remove it and convert the driver to use device tree instead. > > ... > > > + chip->reg = devm_regulator_get_optional(&client->dev, "vref"); > > + if (!IS_ERR(chip->reg)) { > > Why not to go with usual positive conditional? I took this pattern from ad7266.c which Lars pointed me to. I agree that a positive conditional here would probably be more natural. I'll change that if you'd prefer. > > + ret = regulator_enable(chip->reg); > > + if (ret) > > + return ret; > > + > > chip->command |= AD7291_EXT_REF; > > + } else { > > + if (PTR_ERR(chip->reg) != -ENODEV) > > + return PTR_ERR(chip->reg); > > + > > + chip->reg = NULL; > > + } > > ... > > > +static const struct of_device_id ad7291_of_match[] = { > > + { .compatible = "adi,ad7291", }, > > > + {}, > > No need for comma. Indeed, I'll drop it. > > > +}; > > ... > > > + .of_match_table = of_match_ptr(ad7291_of_match), > > No need to use of_match_ptr(). Haven't you got a compiler warning in !OF case? Hm, no warning as far as I can see with !OF... but agreed that this doesn't make much sense as-is. Is dropping of_match_ptr() the preferred route here? The driver doesn't depend on OF, so it seems like keeping of_match_ptr and instead guarding the ad7291_of_match table with #ifdef CONFIG_OF would be preferred. Of course, maybe that's not worth it for saving some bytes from the final image. Let me know which route would be preferred. Thanks again, Michael