From patchwork Thu May 9 20:11:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1097666 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="m20C/ZQj"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 450PhR6HVjz9sBV for ; Fri, 10 May 2019 06:14:47 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 8279BC21CB6; Thu, 9 May 2019 20:13:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2E730C21E1E; Thu, 9 May 2019 20:12:24 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E73ABC21C27; Thu, 9 May 2019 20:12:13 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by lists.denx.de (Postfix) with ESMTPS id 0F45FC21DD3 for ; Thu, 9 May 2019 20:12:10 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id y5so4695320wma.2 for ; Thu, 09 May 2019 13:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1SLMRzWczuNfUCUwN+RIUjLV8pc7CY/xg6Z2za+qU2c=; b=m20C/ZQjJda5cpGmgqFaeOn8+mVAQNICBDytsxlmW/2pOUOQbbXeIT4lN3ikPQpk4B kheFYmhw13xfCT+7KDXtBPJzpAxjADvH2FNnPWm0ArSHTwZTXfdy3THV8h2t+5HcEsgs DLV0DMKDK4VwAqWGMobJe/SWmQYPAUJnnMxyc05H/PhbdQq/k8e7brWMz5m4gtIe8RHF sdJbuvORIBTPkSBBwpkTyUakQDpinVi8sJo7SuI/cqq1ZTCiRR+cn8+hTSbBrNRsVNcF GTEE1/6f4jZ77zwZuo2DSRVnwScf4xFefBdhWm1CsK90GPWU4BguKnswIEINoSQpgeSk leCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1SLMRzWczuNfUCUwN+RIUjLV8pc7CY/xg6Z2za+qU2c=; b=ULQbXB6NsWRzZQLYr8pYEgEH3fSVDRcL1XGY95eP0DCEEF9MwsRfl6OJr/MpCisJMu 4lTY0TQh82SeQi3pUFIbD9z9X/LwOtmB0CcaJR/Ti0tQDQ9ORnlQ99ulvsNF+Ex2nu48 GvWfrJo56r4GdiijXokv2RlggURl5NpOZnZh0kmLO/7w0X9EafscqMw/xPidsZ7lIDxd YW+AGWj6DAjisTxM6heCyOtYGWSOiuaxCTXiCLrCoVSUrItQY8JigBGADE9KgpS37J8D 5+gS1ZcIQUe/IRNq4Fhp2UizVFasiCLb76PMnv+lA8ix1srfrccbtCeTGXj5vIWBvRRb iTqA== X-Gm-Message-State: APjAAAXIPlpJBxnivzhSokT0AOaU9kOitDt7JBb/+xogrwM1QXlhhm/K ep8RxNGTce/uaDCww19yGUs= X-Google-Smtp-Source: APXvYqzJVwJh1OBT3IBoGl3+JKXONpdZTYm5a0mD65yQIu2FrZtiPtu3tkUMO02XAfHAr0iABNi9FA== X-Received: by 2002:a1c:f504:: with SMTP id t4mr4145048wmh.121.1557432729788; Thu, 09 May 2019 13:12:09 -0700 (PDT) Received: from ubuntu.home ([2a02:8071:6a3:700:2df8:99ba:e50f:756b]) by smtp.gmail.com with ESMTPSA id a20sm8326402wrf.37.2019.05.09.13.12.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 13:12:09 -0700 (PDT) From: Simon Goldschmidt To: Marek Vasut Date: Thu, 9 May 2019 22:11:57 +0200 Message-Id: <20190509201200.10336-4-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> References: <20190509201200.10336-1-simon.k.r.goldschmidt@gmail.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 3/6] spi: designware: convert to livetree X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Convert 'dw_spi_ofdata_to_platdata' to use 'dev_read_u32_default' instead of 'fdtdec_get_int' and get rid of DECLARE_GLOBAL_DATA_PTR. Signed-off-by: Simon Goldschmidt --- drivers/spi/designware_spi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c index dadb6fa18b..7d58cfae55 100644 --- a/drivers/spi/designware_spi.c +++ b/drivers/spi/designware_spi.c @@ -22,8 +22,6 @@ #include #include -DECLARE_GLOBAL_DATA_PTR; - /* Register offsets */ #define DW_SPI_CTRL0 0x00 #define DW_SPI_CTRL1 0x04 @@ -155,14 +153,12 @@ static int request_gpio_cs(struct udevice *bus) static int dw_spi_ofdata_to_platdata(struct udevice *bus) { struct dw_spi_platdata *plat = bus->platdata; - const void *blob = gd->fdt_blob; - int node = dev_of_offset(bus); plat->regs = (struct dw_spi *)devfdt_get_addr(bus); /* Use 500KHz as a suitable default */ - plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency", - 500000); + plat->frequency = dev_read_u32_default(bus, "spi-max-frequency", + 500000); debug("%s: regs=%p max-frequency=%d\n", __func__, plat->regs, plat->frequency);