Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2303696ybi; Mon, 1 Jul 2019 09:40:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcDFzZUGfwT4SXlRfrHt3+7HSql0LKkCFLtKe3XqaJRET+3OUNhC5X6RUNDzSSv+r2UCWR X-Received: by 2002:a63:d53:: with SMTP id 19mr26479378pgn.453.1561999207038; Mon, 01 Jul 2019 09:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561999207; cv=none; d=google.com; s=arc-20160816; b=BX5zf1jubd2L1QttxqDMgbhUq7fic0jJPwZx4hmtQWMa7OcX3aGA4G9YOJcCP6pEld +ZR4W2d5VdBe9byynQCEGxt5XOoeS+NhKHVGqIV08V3jT4nnnqlTp/a/GJV+6vsNdKuC xpw0ygFeYIF5YVAU/tLI1v4nCn9rN4Bli1GHqxajrGyHk5/FnmhBMHw0AMgOIbOFxTOO PuEW4hmxSTWw+0Yl/xNMiE1Qd9UFurPVwxIgqq4qmtAhPNDQV5y7FkjdHXTskwfKJEqc Aopkmmf173JHVAj7PhWTAbm7KcwEewNzJfJT5eD80em991EfVikK6nxYSx7dtOS1E+xb Zq6A== 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=IetNNsaoWLkYSAXHE+XLJKKaYo2maSqrxawr9i3AODM=; b=n0o49PiaMNhtWDlfTv4cKR5i04D5ifRGaAfHDUhT/K2R72bpmvw2e03dO3AjJ9E/BK iRpkCI6P4RrtDOV5D7hgyzRHMgYQ3y3GRjay8L0DDPwoJySk13myU5fy8c7CR9UlfgMv eBJfvlPUAqCmsnV9MJMwuFk3OuHSThVFHvzy+XOsaRljgGW8h3dPls85xTiXm63WUPNv 6IhpcWmkKEGIOcYVKuUOF1XBd6qbTFbLGMv4W+9sU9ihJr43MIoDMmhNJj9ev7nv+UA2 VebI6DuYJ1FbQ6LTL6O5N7KYXaAp9fBS6s8xgj4fWhu/OLOdKSol3mO9sfBEAACGA2x5 hx9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=aOPoFzu5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r204si11465604pgr.243.2019.07.01.09.39.51; Mon, 01 Jul 2019 09:40:07 -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=@lunn.ch header.s=20171124 header.b=aOPoFzu5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730243AbfGAQDQ (ORCPT + 99 others); Mon, 1 Jul 2019 12:03:16 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:46012 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727419AbfGAQDQ (ORCPT ); Mon, 1 Jul 2019 12:03:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=IetNNsaoWLkYSAXHE+XLJKKaYo2maSqrxawr9i3AODM=; b=aOPoFzu5X7DIXa6UoMwgiG7W4O dEG+8mePAq/q1GKJV5ij276Gar/vIfjp5D6Gn+ilv3X7r4mITYTQBKzBmDCOqmazbSVrCZpM0Rgfu bD1AXorJAWLUU/UpxuflwHXIkXlpVBNaXiBRvzQzEL8HCGlLZCOkd1UZFV2oAk/bcK/Q=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hhylr-0008CQ-5d; Mon, 01 Jul 2019 18:03:11 +0200 Date: Mon, 1 Jul 2019 18:03:11 +0200 From: Andrew Lunn To: Pawel Dembicki Cc: linus.walleij@linaro.org, Vivien Didelot , Florian Fainelli , "David S. Miller" , Rob Herring , Mark Rutland , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] net: dsa: vsc73xx: Split vsc73xx driver Message-ID: <20190701160311.GB30468@lunn.ch> References: <20190701152723.624-1-paweldembicki@gmail.com> <20190701152723.624-2-paweldembicki@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190701152723.624-2-paweldembicki@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -495,12 +380,12 @@ static int vsc73xx_update_bits(struct vsc73xx *vsc, u8 block, u8 subblock, > int ret; > > /* Same read-modify-write algorithm as e.g. regmap */ > - ret = vsc73xx_read(vsc, block, subblock, reg, &orig); > + ret = vsc->ops->read(vsc, block, subblock, reg, &orig); > if (ret) > return ret; > tmp = orig & ~mask; > tmp |= val & mask; > - return vsc73xx_write(vsc, block, subblock, reg, tmp); > + return vsc->ops->write(vsc, block, subblock, reg, tmp); This patch would be a lot less invasive and smaller if you hid the difference between SPI and platform inside vsc73xx_write() and vsc73xx_read(). > -static int vsc73xx_probe(struct spi_device *spi) > +int vsc73xx_probe(struct vsc73xx *vsc) > { > - struct device *dev = &spi->dev; struct device *dev = vsc->dev; and then a lot of the changes you make here go away. In general, think about how to make the changes small. It saves your time from actually making changes, and reviewer time since the patch it smaller. Andrew