Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp11325319pxu; Thu, 31 Dec 2020 06:26:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpUt7XenTa6u0jJI/2rrU3CplqJKNqad886rkXpYJj+AjnGKGy28HvxDYwVWwrbcQ4yrUd X-Received: by 2002:a17:906:31d2:: with SMTP id f18mr53144517ejf.407.1609424770994; Thu, 31 Dec 2020 06:26:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609424770; cv=none; d=google.com; s=arc-20160816; b=f6sIipMb/KnLIJKVBmx7n0P2L3/5QCX9bzisAb0m069Mzq0bRMO6VAP/g4wzs4uEQ0 FZOgHAayCx3osJNN0ZLj9lGFZF+wHCONsheJuOC7hikL4rSuzTOb0ts5b5fFUjSVJ9i7 //XBIUGunfOyesWI/SNs7XAnB+xWNwojzFeF6J6QKWzvk4eIpLWsbtiwI1BCAbihqGUC vZFjKLPng2PuXOlq0vjlaMjoaijeMVY3xAzvxraA01u8HKKb93OhtJh+OvbxYxGeApfY o4lPo4WdOj+4kUFVoVWQp7ldJg4wLM7vRE0pwVxsbGSj9xXfWNx5LY8NodgF4DIlfvPB aQsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=WMWdtnYL0aii70zOvBdIRmaxf9yUASNZ3Tfbox0Ijuo=; b=yMtUv3vn1dvu7JYhl4WXQr5ogjHO13vef4PX2asv1zvn4ZlKEdo1p9mM5HBBDNcthF /yjQqjBl5dLXMQlIlgq2qxJa6cgCmxZ/X4GQ/woX1xD9hRvIruQyQO9Gcph+agz/FJ/9 SXLBXMVGyieCXKLvcsiSNd0Lco/VWa2sFKgn8hPcS+LtBbhCQLteW6YWMh2AVLNvCKpn QfgNBn4IWYvOr+VVJsdXl7GHgz7ZqWzosSgQCdE503FIzJ6pnT7TojBZVCPnUDLnnSui Wfu9hbaRXrXBttNwCIgUkDKE2Z9/e8HHprypRX3LQOx4r9aN5rwAj/oxUZFMFnTE2USD szlg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co9si23870498edb.379.2020.12.31.06.25.49; Thu, 31 Dec 2020 06:26:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726348AbgLaOYD (ORCPT + 99 others); Thu, 31 Dec 2020 09:24:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726071AbgLaOYC (ORCPT ); Thu, 31 Dec 2020 09:24:02 -0500 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F26CC061573; Thu, 31 Dec 2020 06:23:22 -0800 (PST) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id C39C830000899; Thu, 31 Dec 2020 15:23:19 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id B1FD74EA00; Thu, 31 Dec 2020 15:23:19 +0100 (CET) Date: Thu, 31 Dec 2020 15:23:19 +0100 From: Lukas Wunner To: Bert Vermeulen Cc: Mark Brown , Rob Herring , Birger Koblitz , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND v2 2/2] Add support for Realtek RTL838x/RTL839x SoC SPI controllers Message-ID: <20201231142319.GA28104@wunner.de> References: <20201229231904.2558916-1-bert@biot.com> <20201229231904.2558916-2-bert@biot.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201229231904.2558916-2-bert@biot.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 30, 2020 at 12:19:04AM +0100, Bert Vermeulen wrote: > +static inline void wait_ready(struct rtspi *rtspi) > +{ > + while (!(readl(REG(RTL8380_SPI_SFCSR)) & RTL8380_SPI_SFCSR_RDY)) > + ; > +} I'd suggest calling cpu_relax() in the loop's body. > + err = devm_spi_register_controller(&pdev->dev, ctrl); Since you're invoking devm_spi_register_controller() on probe, the controller must not be unregistered explicitly on remove. So the ->remove hook can be dropped altogether: > +static int realtek_spi_remove(struct platform_device *pdev) > +{ > + struct spi_controller *ctrl = platform_get_drvdata(pdev); > + > + spi_unregister_controller(ctrl); > + > + return 0; > +} [...] > + .remove = realtek_spi_remove, The ->probe hook otherwise LGTM. Thanks, Lukas