Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp446215pxb; Wed, 20 Jan 2021 10:49:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5cfMFfmRJWVxZ0BfUGUTS+zG3MeKmn/SXllvJowqyGcdAF3bhIRHATjGSwLCLPZ0NZQiy X-Received: by 2002:a17:906:5618:: with SMTP id f24mr6984361ejq.517.1611168548479; Wed, 20 Jan 2021 10:49:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611168548; cv=none; d=google.com; s=arc-20160816; b=POi5dXciRqEzOVg61aUI5lpoD82y0GdftahzpKH3Q/i6YptBo6bsWjxx7W2wS15qMS 4pct1sWhf0E9SfLgNEWROLD/5CHTgNWgGChagvAOnLaH31Foar751nbzDl40zVRrDCiL 9GiBznIO0TfJfhpAcjBhx+Lg7vdoJ2il+XwA7JTqL3ccvBJbNi0Aw4/ejlj6DFrvl3VV gHpFWi66QAsClltOZQf7j1WIxKvrSVr5pDpMbJbVGcJ+YFhPpkRiBKBEGVvxdEAknOqq tNXwNti3lX5eQk8a/5VoertuijfkSglaujTXHnHZvTfENSHKDM1aaLxneJL1ZPc6/Sqm A+mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DbjCwstmUaHfU0p6M3ixslMg4pkSwHqVC4Cq5uKXI7Q=; b=uHjPrOkzVdTHMmMYLjZ8j1oHe5MFqhJ9LE+dExhXTN2p4NDU5h4/nEV5wUjL4Q4wXu hyH9csxXxXv3qKIEC9ijWl0NRWmK0eT0DueCpBU7r/h65FBH2FWV8MK/ByOJ+NBTjuTu ka0Wpr8GqxJjIyl8ygbtL+YqZfpNBhOD3YtcLVTKIeJ/zTE9kySAyWi+RHFEJ6xE9mDq eRPxbRbKkfW6eb9lFDUvLzvQ4FXKKXlQ1mXyA3QM+gTZOqIpXF5ch9TnXpmQlsZ3bVJV BSDUZj9P3sXmdc1rW/TbQ1xGAmIweOitH4Ff/rCpIpY7js8709VPtBRdp9cYqtlksTtv foDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NTIzj6S5; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs19si1159974edb.212.2021.01.20.10.48.43; Wed, 20 Jan 2021 10:49:08 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=NTIzj6S5; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390258AbhATSrz (ORCPT + 99 others); Wed, 20 Jan 2021 13:47:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731366AbhATSkf (ORCPT ); Wed, 20 Jan 2021 13:40:35 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66749C061575; Wed, 20 Jan 2021 10:39:55 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id dj23so24403701edb.13; Wed, 20 Jan 2021 10:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=DbjCwstmUaHfU0p6M3ixslMg4pkSwHqVC4Cq5uKXI7Q=; b=NTIzj6S5KVkB1RWWZJup/A7oB/bzRIPDxOb3bA1giOos4rsgzam9AoBMnee3z0VDgJ bWb+UMfXyYMsan8UqylWp4FjW/HAKA/xSE1RWfQayFLhoSIrPlAQ/2MBlw/CTAOYpQKf vRV/PHq0zBbVwAe551yjmdykkovpUVMfokeypkQlPYEFiwPzdrZw5YZZZKoqanFfuiKZ iGyIc9LKgnc+ih/4WGlfx7tMdFcdjDdvRxd4ogOk2Jz4qnL2cmoCIqEhppTLatc4Gby0 TmyE8n6BsPdyGKGsWSArT0hb1NhmEr+Si3u5bgyj6qf4ykp3R8w9m/TZh326odbnQBjT 2FPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=DbjCwstmUaHfU0p6M3ixslMg4pkSwHqVC4Cq5uKXI7Q=; b=NkHOczF3LXlxqy2TRCJPn+6o+C/3LL1Ecgha+8jA3Cq/g+K0DRlB1Sd/FNKODogt5i GbevRIXKyf0yZOXUxXPJnLvQqRvy63JLj1gc2UndWABMk9Sjk6CITGqpE54O4aa1WyIf tNdnlwLgElnNkj0fvxkCseOZLttwcEv5h/L4BhiJnhGZkG9ySn7gmawUngTCYfWB0G1h 0azU0adN1L+Zx+f+erB1mGktQ8MdwAo+BPNQ9UEkI3UJ2DIMqfP1WmkQtIkDLUT9uOzv tghJDoCfViqMCe2EktC3Dr4h2ZTtNdbs8e6qglCP1ZqWevmxoMeWHhwifR6ONY5bgSH8 wFAg== X-Gm-Message-State: AOAM530u2Y4dfnPQdYmQo0plW5dtgDgJUKTZcdoxI71fDYHinbYtEsa8 i70PimUCjNlMODW9IIhAU9k= X-Received: by 2002:aa7:cdcb:: with SMTP id h11mr8371260edw.237.1611167993530; Wed, 20 Jan 2021 10:39:53 -0800 (PST) Received: from BV030612LT ([188.24.159.61]) by smtp.gmail.com with ESMTPSA id g25sm1488542edw.92.2021.01.20.10.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 10:39:52 -0800 (PST) Date: Wed, 20 Jan 2021 20:39:50 +0200 From: Cristian Ciocaltea To: Lee Jones Cc: Mark Brown , Rob Herring , Dmitry Torokhov , Sebastian Reichel , Manivannan Sadhasivam , Liam Girdwood , Andreas =?iso-8859-1?Q?F=E4rber?= , Linus Walleij , linux-actions@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v5 3/7] mfd: Add MFD driver for ATC260x PMICs Message-ID: <20210120183950.GA867982@BV030612LT> References: <81546cf3265f51374a1b38b9e801003fd6c3e298.1610534765.git.cristian.ciocaltea@gmail.com> <20210120083348.GM4903@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210120083348.GM4903@dell> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 08:33:48AM +0000, Lee Jones wrote: > On Wed, 13 Jan 2021, Cristian Ciocaltea wrote: > > > Add initial support for the Actions Semi ATC260x PMICs which integrates > > Audio Codec, Power management, Clock generation and GPIO controller > > blocks. > > [...] > > + /* Initialize the hardware */ > > + atc260x->dev_init(atc260x); > > + > > + ret = regmap_read(atc260x->regmap, atc260x->rev_reg, &chip_rev); > > + if (ret) { > > + dev_err(dev, "Failed to get chip revision\n"); > > + return ret; > > + } > > + > > + if (chip_rev > 31) { > > Nit: If you have to respin this, please define this magic number. > [...] > > +static struct i2c_driver atc260x_i2c_driver = { > > + .driver = { > > + .name = "atc260x", > > + .of_match_table = of_match_ptr(atc260x_i2c_of_match), > > + }, > > + .probe = atc260x_i2c_probe, > > +}; > > Nit: These spacings/line-ups just look odd. > > Please stick to one ' ' after the '='. [...] > > + const char *type_name; > > + unsigned int rev_reg; > > + > > + int (*dev_init)(struct atc260x *atc260x); > > Ah, I didn't see this before. > > Call-backs of this nature are the devil. Please populate a struct > with the differentiating register addresses/values instead and always > call a generic deivce_init(). I have implemented this, including the other 2 suggestions above, in the already submitted revision v6. Thanks, Cristi > > +}; > > + > > +struct regmap_config; > > + > > +int atc260x_match_device(struct atc260x *atc260x, struct regmap_config *regmap_cfg); > > +int atc260x_device_probe(struct atc260x *atc260x); > > + > > +#endif /* __LINUX_MFD_ATC260X_CORE_H */ > > -- > Lee Jones [李琼斯] > Senior Technical Lead - Developer Services > Linaro.org │ Open source software for Arm SoCs > Follow Linaro: Facebook | Twitter | Blog