Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4588821ybl; Mon, 9 Dec 2019 13:27:59 -0800 (PST) X-Google-Smtp-Source: APXvYqy+OD/Z15y6QR3ov9T1YALI2LBlSdrFDBI9FsMU0mFwID7q9MwTyS14ByKBTNyhMhEsCu4m X-Received: by 2002:a05:6830:12cf:: with SMTP id a15mr23347589otq.222.1575926879191; Mon, 09 Dec 2019 13:27:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575926879; cv=none; d=google.com; s=arc-20160816; b=cdQRaUU9z52ZuRbF+u8psbd+GZxJgUSIEX2nqjXkjdmReUdhHp2ADlFIZzg4E1K+GD iuHCWQ4joUKrUPYdxGTOJ5XvDMWTDp8QzQVotY/bj544tOvrI5/D18UZXMi3sz82SfEM KB0S2pNrRAIas09MZHdBeOqReYydJ+82Mq7aDmP4fK82wWGGY+AuRz8HY/8U9rTrTR6y OuEQeMDSf6qOyK9CK4oVZJgBjouNu8/P+PdlKq/Bfc8h58nREYhy9z6mK0M3WdAa4RQP MaUA2TmPhgCcLxYGiHk/fKSrSEISDd9uBdbMLJ9pvtZVB6P8OCDr9YuVYcziedcSpWaf JRrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1gk21y/pQ6pPIfwAOcAQmC6TMPt+CKlLB8VJzkcowJc=; b=yMvnVoAkg1u27+QewpUE6i/nM+LsWyNkXQxU+UyNJcY4YoMY8IZyKg0OFG5VzJFN5M tU4LMkwTnFuD7MBw4wDBIAnY8ZtnonTT+Lqyh643j2Z8Re+tvfYFHBrW3DRlO3lnF3I2 VhzJ8ihpDDwna5bzEuTE4Vw37nZq6fSB7L8cU6CFRlcJt8UZhFtGr0TnzilBwfXng482 W+Wx2mzt9OA4yTJuDXD6PYDRq3f6AR/rFETv0QEDRIkI0RN+L3zqM8lL5u7wA9uL7GFO zhvtrxNMK+vYLgwuvvwpbA5/ER++w8Ugy781iR53crZ5s5aqDZGqOqQanBLOfxS4yDRr /YuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cx6utzfe; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si755297oie.22.2019.12.09.13.27.46; Mon, 09 Dec 2019 13:27:59 -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=@ti.com header.s=ti-com-17Q1 header.b=cx6utzfe; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726614AbfLIV0G (ORCPT + 99 others); Mon, 9 Dec 2019 16:26:06 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:54100 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbfLIV0G (ORCPT ); Mon, 9 Dec 2019 16:26:06 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xB9LPxaH052942; Mon, 9 Dec 2019 15:25:59 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1575926759; bh=1gk21y/pQ6pPIfwAOcAQmC6TMPt+CKlLB8VJzkcowJc=; h=From:To:CC:Subject:Date; b=cx6utzfePBIrFOCz8SZnoLJ2TcFye6i+0O5Cj2ytVnWWShvt70gkxepyPSWe62vqA /LWqqU8oOzOI3BTT0EF9lDgjdiHrdH8G+7q+Se1UYhdqeNrfs4NyV9VfiFyIcOUCcV C4qcu3Yw6lOhP9wUPuwq0L5XbYnJR1G57dXa2kFY= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xB9LPxxV077034 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Dec 2019 15:25:59 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 9 Dec 2019 15:25:59 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 9 Dec 2019 15:25:59 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id xB9LPxDe011052; Mon, 9 Dec 2019 15:25:59 -0600 From: Dan Murphy To: CC: , , , Dan Murphy Subject: [PATCH] can: tcan4x5x: Turn on the power before parsing the config Date: Mon, 9 Dec 2019 15:23:51 -0600 Message-ID: <20191209212351.27518-1-dmurphy@ti.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The parse config function now performs action on the device either reading or writing and a reset. If the regulator is managed it needs to be turned on. So turn on the regulator if available if the parsing fails then turn off the regulator. Fixes: a5235f3c7c23 ("can: tcan45x: Make wake-up GPIO an optional GPIO") Signed-off-by: Dan Murphy --- drivers/net/can/m_can/tcan4x5x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c index 4e1789ea2bc3..515486fcb150 100644 --- a/drivers/net/can/m_can/tcan4x5x.c +++ b/drivers/net/can/m_can/tcan4x5x.c @@ -451,11 +451,11 @@ static int tcan4x5x_can_probe(struct spi_device *spi) priv->regmap = devm_regmap_init(&spi->dev, &tcan4x5x_bus, &spi->dev, &tcan4x5x_regmap); + tcan4x5x_power_enable(priv->power, 1); + ret = tcan4x5x_parse_config(mcan_class); if (ret) - goto out_clk; - - tcan4x5x_power_enable(priv->power, 1); + goto out_power; ret = m_can_class_register(mcan_class); if (ret) -- 2.23.0