From patchwork Wed Aug 8 15:31:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10560209 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D14A013BB for ; Wed, 8 Aug 2018 15:34:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAC7029E6D for ; Wed, 8 Aug 2018 15:34:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEA0E29EF1; Wed, 8 Aug 2018 15:34:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EAD729E6D for ; Wed, 8 Aug 2018 15:34:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730522AbeHHRyg (ORCPT ); Wed, 8 Aug 2018 13:54:36 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35025 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730531AbeHHRyf (ORCPT ); Wed, 8 Aug 2018 13:54:35 -0400 Received: by mail-wr1-f66.google.com with SMTP id g1-v6so2423876wru.2 for ; Wed, 08 Aug 2018 08:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5BmTvmpqVPdPXiWZLqUzgpWunx/nLJo3Onxdpacg0zI=; b=Kis6cTi+w4SEAI/fwvgBrnj472bwYN+eyv3mo4kGmNQZDXxuLvKb94AGGLiHNSluxG 2U8ySAl8kvhqXbe2XhqUaf010LnH6lGXajML/GnE2zBMR1XM77EY31pxw/b1GdGnCZx5 gJOe0IfIUYJkGio9jj5W+yBVZYIlJGQVF54kEeEoMADSIZoHwsXHaBmI9vj7cwYVPs/D i3KLzjafr7kQx93rS+kuCWvz8fPGBU81PxZEPcgXnNzwETjXU43zkWGjIpBDTRBMFyiK DLgcYgpWKxPBpCaCZvyhg/gFXQiVf4u2d0Xs1jOd81NQQj0YaU7PeELSb+8PWjY8TE92 DySw== 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; bh=5BmTvmpqVPdPXiWZLqUzgpWunx/nLJo3Onxdpacg0zI=; b=Ij6XBS5i+iFZAh9AwZPm2DAJsB4+SPDIOuej4TQ8k1hlApUCJQvE/TQNBEd2WWzvzL lP7PEqqlQMr+VEixtt8xl76k5FYg4m5+VOFpiXjxUQ+j2Nqg+9GjzpqWTArwnb5bDsyb 5ipSU4oOiVs1PSuhMA+wz9Ios0K6k1Jt54JmXtdfYb1OwA2RsiyCTUFY32pr9KFjGhYl qDG+Cre33RxnaXgoaBQx8wdkKXY7Fr8GrdDYBsmzRgWpnU1r4kFl0o9ISw1fv4+ohS9O ekI4Ww+zILEgMoYunUXClwiDawyfTz4oSbedlPRSFYGWD7Nz+yfzPeqP3RBBHJzmH0EG NVdw== X-Gm-Message-State: AOUpUlFexDMczyXwcn3VMLdjnhjTo3tz6Ln0xQDLeYs5vuojWqp73sMp AFXhYOGPC+4nmQJDcNpiAqRlJg== X-Google-Smtp-Source: AA+uWPyV6VlTlRaeC+r3kKWHdhHVBLwAS1LLrrv0m4zb7VzKaj+yFJ5m6ik4UauW9bSl3bGOalwxjQ== X-Received: by 2002:a5d:4d8d:: with SMTP id b13-v6mr2149850wru.80.1533742463447; Wed, 08 Aug 2018 08:34:23 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-MAR-1-609-89.w90-118.abo.wanadoo.fr. [90.118.185.89]) by smtp.gmail.com with ESMTPSA id s2-v6sm5240915wrw.52.2018.08.08.08.34.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 08:34:22 -0700 (PDT) From: Bartosz Golaszewski To: Jonathan Corbet , Sekhar Nori , Kevin Hilman , Russell King , Arnd Bergmann , Greg Kroah-Hartman , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Naren , Mauro Carvalho Chehab , Andrew Morton , Lukas Wunner , Dan Carpenter , Florian Fainelli , Ivan Khoronzhuk , Sven Van Asbroeck , Paolo Abeni , Alban Bedel , Rob Herring , David Lechner , Andrew Lunn Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 27/28] ARM: davinci: mityomapl138: use device properties for at24 eeprom Date: Wed, 8 Aug 2018 17:31:49 +0200 Message-Id: <20180808153150.23444-28-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180808153150.23444-1-brgl@bgdev.pl> References: <20180808153150.23444-1-brgl@bgdev.pl> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We want to work towards phasing out the at24_platform_data structure. There are few users and its contents can be represented using generic device properties. Using device properties only will allow us to significantly simplify the at24 configuration code. Remove the at24_platform_data structure and replace it with an array of property entries. Drop the byte_len/size property, as the model name already implies the EEPROM's size. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- arch/arm/mach-davinci/board-mityomapl138.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c index 17b67e26bc0e..be0fb7d17e25 100644 --- a/arch/arm/mach-davinci/board-mityomapl138.c +++ b/arch/arm/mach-davinci/board-mityomapl138.c @@ -14,11 +14,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -185,10 +185,9 @@ static struct nvmem_cell_lookup mityomapl138_nvmem_cells[] = { } }; -static struct at24_platform_data mityomapl138_fd_chip = { - .byte_len = 256, - .page_size = 8, - .flags = AT24_FLAG_READONLY | AT24_FLAG_IRUGO, +static const struct property_entry mityomapl138_fd_chip_properties[] = { + PROPERTY_ENTRY_U32("pagesize", 8), + PROPERTY_ENTRY_BOOL("read-only"), }; static struct davinci_i2c_platform_data mityomap_i2c_0_pdata = { @@ -317,7 +316,7 @@ static struct i2c_board_info __initdata mityomap_tps65023_info[] = { }, { I2C_BOARD_INFO("24c02", 0x50), - .platform_data = &mityomapl138_fd_chip, + .properties = mityomapl138_fd_chip_properties, }, };