From patchwork Sat Dec 19 17:40:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1418739 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=TY3tO3Wo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CytNH1k8yz9sVm for ; Sun, 20 Dec 2020 04:42:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BD6498289B; Sat, 19 Dec 2020 18:41:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TY3tO3Wo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A2A9F82878; Sat, 19 Dec 2020 18:40:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E68DA82816 for ; Sat, 19 Dec 2020 18:40:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x135.google.com with SMTP id k8so5209284ilr.4 for ; Sat, 19 Dec 2020 09:40:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U5QR8Y9e1QEHBTJbuLIDszQUd0t8zFPctnBAb/N1vfQ=; b=TY3tO3WoBVdvBRVnldFnC/5hUjhRnluDC5rDiCvEN5G68zoTyWmTYOHcLi3eaNPGYb YOTlmNZoqRYe7FKm41zfb03cihPv0+CkJFl9Rg3wUX5QkyKP+pnw/qohAqvn4Zvg2cxC 3+hw6WrUqj2NuzTEVOQkayFOoryOWt5j0T4Bw= 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=U5QR8Y9e1QEHBTJbuLIDszQUd0t8zFPctnBAb/N1vfQ=; b=Ji5PEAIunQDcgwPKY2KR53O9LBbPASpMy/4vrvsdbzD7sIGLilIuKChV7tmJ/EHCrF uRnxixNCQUiNG/+YEszpd/CpYzOKt8boWDqxOZdxRtqFzSzrgq0/D/TMe5qAVhgaxJ75 Cfx6HGH5ox8PaTPREjIRSYUfq8tuoVrh+ihF/Ou6jovxvTEpzH7kC5zxdUtDr3WtNqyI 5Ot5pFtZUpMHC411vuDon4EWzvp2/HWNVx9tES5oT+jl+b2lQ2fWWGtG6GH0A9f98+UK nPV134SwPIshjbUMYrW5Dj5kyqrebv9/MyGWxQG8qV8h+Iw1l3mmLBcOixMONMdHDi3M t6MQ== X-Gm-Message-State: AOAM530ZHTdJ5iC9FF8E7BD0rP16KLgtTCj4i1jYR1MKVfVGBRD5idx8 +qkVPVievEZ2cg7Vfmopl5Jb72yJCIp7Cz3E X-Google-Smtp-Source: ABdhPJxziVT7le9N4uPF7FwEkFfGvOl554nvHPJ9YzfDDCYkTVLm8GYOTWkknRcA7PkVoo5+aN56Mw== X-Received: by 2002:a92:da82:: with SMTP id u2mr10008348iln.137.1608399639569; Sat, 19 Dec 2020 09:40:39 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id n10sm9781962ila.69.2020.12.19.09.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 09:40:39 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Jagan Teki , Jagannadha Sutradharudu Teki , Vignesh R Subject: [PATCH 09/26] spi: Tweak a few strange SPI NOR features for of-platdata Date: Sat, 19 Dec 2020 10:40:01 -0700 Message-Id: <20201219174018.1114146-8-sjg@chromium.org> X-Mailer: git-send-email 2.29.2.684.gfbc64c5ab5-goog In-Reply-To: <20201219174018.1114146-1-sjg@chromium.org> References: <20201219174018.1114146-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The #define of one struct to another has been around for a while. It confuses dtoc and makes it think that struct spi_flash does not exist. Make a few changes to improve things while we wait for migration to be completed: - Move the 'struct spi_flash' to column 1 so dtoc scans it - Remove the #define when compiling dt-platdata.c - Update the strange mtd_get/set_of_node() functions - Use struct spi_nor in the drivers, so dtoc sees the correct struct Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- drivers/mtd/spi/sf-uclass.c | 2 +- drivers/mtd/spi/sf_probe.c | 2 +- include/linux/mtd/spi-nor.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/spi/sf-uclass.c b/drivers/mtd/spi/sf-uclass.c index ed629f1d458..3017022abbb 100644 --- a/drivers/mtd/spi/sf-uclass.c +++ b/drivers/mtd/spi/sf-uclass.c @@ -100,5 +100,5 @@ UCLASS_DRIVER(spi_flash) = { .id = UCLASS_SPI_FLASH, .name = "spi_flash", .post_bind = spi_flash_post_bind, - .per_device_auto = sizeof(struct spi_flash), + .per_device_auto = sizeof(struct spi_nor), }; diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index c8bcec3c589..630787df1bf 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -166,7 +166,7 @@ U_BOOT_DRIVER(jedec_spi_nor) = { .of_match = spi_flash_std_ids, .probe = spi_flash_std_probe, .remove = spi_flash_std_remove, - .priv_auto = sizeof(struct spi_flash), + .priv_auto = sizeof(struct spi_nor), .ops = &spi_flash_std_ops, }; diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 2642bf91d00..363f2749d7d 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -258,11 +258,13 @@ struct flash_info; /* * TODO: Remove, once all users of spi_flash interface are moved to MTD * - * struct spi_flash { +struct spi_flash { * Defined below (keep this text to enable searching for spi_flash decl) * } */ +#ifndef DT_PLATDATA_C #define spi_flash spi_nor +#endif /** * struct spi_nor - Structure for defining a the SPI NOR layer