Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753721AbdLHORG (ORCPT ); Fri, 8 Dec 2017 09:17:06 -0500 Received: from mail-it0-f51.google.com ([209.85.214.51]:36894 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753327AbdLHORE (ORCPT ); Fri, 8 Dec 2017 09:17:04 -0500 X-Google-Smtp-Source: AGs4zMa1zVgxnrJrZ3JM3VzuOElE4m1rQb1SC5rarPVQg6XyCulDcgqM6o8pCB6Q14sQU7tuPQv9Jkkf3zCSziZyiCI= MIME-Version: 1.0 In-Reply-To: References: <1512576272-25563-1-git-send-email-svendev@arcx.com> <1512576272-25563-2-git-send-email-svendev@arcx.com> From: Sven Van Asbroeck Date: Fri, 8 Dec 2017 09:17:00 -0500 Message-ID: Subject: Re: [PATCH v1 1/2] eeprom: at24: convert magic numbers to structs. To: Bartosz Golaszewski Cc: Sven Van Asbroeck , Wolfram Sang , nsekhar@ti.com, Sakari Ailus , Javier Martinez Canillas , Divagar Mohandass , devicetree@vger.kernel.org, Linux Kernel Mailing List , linux-i2c Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 557 Lines: 14 Bartosz wrote: >> +#define AT24_OF_DEVICE_ID(_mfg, _name) \ >> + { .compatible = #_mfg "," #_name, .data = &platdata_##_name } > > I don't like hiding the way the compatible is created here from the > user. It doesn't save any code neither. Please make the macro accept > the whole compatible string. > If the macro accepts the whole compatible string "mfg,chip-name" (e.g. "atmel,24c01") then how can I extract chip-name from that string? I need to attach chip-name to the platdata_ static structures. (e.g. "atmel,24c01" -> .data = platdata_24c01)