Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6725493ybi; Mon, 22 Jul 2019 00:26:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2QCWBMNODbRJkUP0nfjHDvjTnYXZ3J9nu+Ir01ILJ+G/Fypqzf/F+P0y5xJd14I6thY9o X-Received: by 2002:a17:90a:d14a:: with SMTP id t10mr35479708pjw.85.1563780411048; Mon, 22 Jul 2019 00:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563780411; cv=none; d=google.com; s=arc-20160816; b=w5m0WuDMvJMEftiyLQBoD+YHbdWkJV2mcTXXtYVp2yBo+9XBjaRX0fX4uCtIwysJB6 W5YQZ1Fbs0HW5IDScF3I50KmPhf/ria5IshDa3wUDh86BB1hPpO72Xwql5E9oScV6Xdh mvu+KPuNDiBl2iFkB++Zx4mPDs7k88EiXt1cPE2aeg9kbm2H/FXRek5RDG4XTJQufOlM B2sT/T6JQd7/PTj8out1ozvwhgGjySX7KwbB5RZsepOBW57Q4FxRmsimSi5aHDZ/nKdS nHKEsZbZL5ashyhWxcJNfyGhGpBk2Pa11ZXbqvfeqGJCox7htO49EpEWeSlsTdpg+0qU geWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=a+4pxoZrWgO5E8eTqf7t3xt/WeKLRxeau7aUPE4BCe4=; b=Hw/Vb50DjZgwvQiSwjDEe7q11U+MAT1824a3uiaobuZnrx7UqtKNECCQbCT+8H9hEu JVUMFlJqyw+FubiU9hL8i6Ckm1LqZu9KcmkW+p2ok2AkcEUUfSEZsWFh8JqwataBvAtb 1fp+NW082kvKx58wM60dsPlASZcJpo604xyXbpSu12RhisnPWOXLE7LZavWff0YcLUqd NqngAVflu1WSADu0zUIZzqCLLJDc/puJFxXm/KWXPbYQ7YUYsnyua31pYkImysWBvtE9 vuwLMLwVmaw6vTW3xmgZDoyrYIe/td4lpGlBbDgBb4gGtGb3T5wknzHONT8lv4g3hRz4 LHQw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18si9935607pjn.74.2019.07.22.00.26.35; Mon, 22 Jul 2019 00:26:51 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728027AbfGVHYg (ORCPT + 99 others); Mon, 22 Jul 2019 03:24:36 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:42337 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726905AbfGVHYd (ORCPT ); Mon, 22 Jul 2019 03:24:33 -0400 Received: by mail-qk1-f194.google.com with SMTP id 201so27852015qkm.9; Mon, 22 Jul 2019 00:24:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a+4pxoZrWgO5E8eTqf7t3xt/WeKLRxeau7aUPE4BCe4=; b=UQHD4PT73y7CX6SeT7wIK2WSKXlKehOyVQC7lIbJFoYsHVLaukfQzxZVu/sEs+z9U8 VRTr+MlmpfElaXZZddoRiMXxLCZ5raWlXXEHSihHUQBwzB4pGzy0Q9sIvemtSTBcGia0 NWxLVmKd09C3tLBpf8IhGGAlZGT6HGpMea3Hwoq4g3C8vnJB4frPwncYiUNhtWncc9Ly Zh4d+WrCmXdI1QIidLxqXirs8mWlVmCVK2y535u968j6OX4ZAvIAtLuPYIsr/uC3EDTD GooOdHv20SjTymm1svB9H9IVpepqAhenprIRMPxMqnV3H280aupFVqSognUavxXgruA4 eDYw== X-Gm-Message-State: APjAAAUPHrr9/nc/gdGWc1IlZYaNK3u9zQ8uAaxJpGL+5eUorQECi0lV v3mYIIl9xwP2QPrB14aMYHzWCKWHeNP+k/Wx5sQBIiD+YY4= X-Received: by 2002:a05:620a:b:: with SMTP id j11mr11642591qki.352.1563780272040; Mon, 22 Jul 2019 00:24:32 -0700 (PDT) MIME-Version: 1.0 References: <21af683a-a188-7aa9-9c82-98c02b8717f8@metux.net> In-Reply-To: <21af683a-a188-7aa9-9c82-98c02b8717f8@metux.net> From: Arnd Bergmann Date: Mon, 22 Jul 2019 09:24:15 +0200 Message-ID: Subject: Re: [Question] orphan platform data header To: "Enrico Weigelt, metux IT consult" Cc: Masahiro Yamada , Ben Dooks , Linux Kernel Mailing List , Linus Torvalds , Greg Kroah-Hartman , DTML , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 22, 2019 at 8:46 AM Enrico Weigelt, metux IT consult wrote: > On 21.07.19 16:15, Arnd Bergmann wrote: > > > That is different: the hardware attaches to a serial port and may well > > be usable, and the user space side just contains a copy of the header, > > see https://github.com/nwdigitalradio/ax25-tools/tree/master/yamdrv > > I believe that such header copies in userland applications are > conceptionally wrong. Whenever something changes, both sides need > to be kept in sync. > > Maybe we should talk to the hamradio folks to get this cleaned up. > IMHO, this header should go to uapi. Having copies of driver specific uapi headers is rather common, and you won't have much success trying to get everyone to change that. The reasons why those applications do it are: - The kernel already gives ABI guarantees so anything built with an old header file is expected to keep working indefinitely. - Using a new header file won't help unless the application also knows about the added interfaces - If an application uses more recent additions to the kernel headers, it either has to have a matching version of that header, or use a long series of #ifdef checks to deal with arbitrary versions. > > It seems more useful to keep looking for drivers with a platform_data > > header file that is no longer included by any platform for candidates > > that may be obsolete. > > Some folks see platform_data old legacy that should be removed, but I > don't aggree. For example w/ apu2 board driver (and corresponding > amd-fch-gpio driver) I even had to introduce a pdata struct, so the > board driver could configure the gpio driver. The case that we are interested in is drivers that previously used platform data in legacy board files that have since been replaced with dtb based boots. > Certainly, I would have > preferred doing everything via DT, but that's not available on x86/acpi > targets (if anybody knows a way to inject a DT snippet just for one > driver in such a scenario, please let me know). It's been done before, but usually with overlays that don't necessarily make it any better than platform data. If you have a set of drivers where one of them creates a platform device for the other driver, then platform data is usually the easiest way, and I'm not aware of any move to get rid of that. As an alternative, you can use the generalized property support from include/linux/property.h that works on top of DT, ACPI or plain platform devices. Arnd