Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3642148pxb; Mon, 24 Jan 2022 14:13:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyD8F490QGUVp70dWeoWMypaUK6sKUS4YgW1H0eUrQp7pb4xHJKe6GmN3GF3UiCbzAvfnT7 X-Received: by 2002:a05:6a00:1745:b0:4c8:b982:d500 with SMTP id j5-20020a056a00174500b004c8b982d500mr8287814pfc.59.1643062392550; Mon, 24 Jan 2022 14:13:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062392; cv=none; d=google.com; s=arc-20160816; b=cjYh5gMzkLaJSGr7WdP820XvTaTUsK/xvIX9qOGaNFbL37UScg1XM4OXUICVRam54r qJoE8ZtlXM376hoxEqG7V2vg0FmA4bxteXKFTQhXTWrUGy6EyyyKEvVvEpM8kRbuNcVk 96vOlgXYh9kuTbpv/wbYsewSnMNTQCMkN4rF62qe3HgwChl6QI1ETwg9ye/jQA1e9ba0 bgQ+WLS0t2RzDj3QfDIEvhJ+XT5MxWl2bUYtGTRmtARvVFKVedJ0u9s4JIO8BdvMyOJi jHfwtAZzIAQU5hiy2t2FnPc92U5XcImcXLLKmNDooOocQmoQ/viuPFe32uV/gI99/sSh ZQqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=b0v3K8MaVKx/3m1xtjL7N8Dow/WGcUGAtvdDQY09opI=; b=U8rqVvB1IiGTCaE+lKG5ssLJj/i5w8ASVcgfPPSpdkHohdnmaFZOPVGsJ1PX1/VZxe aOTVWH9hT2hgrt78bS/qTlnxgp6Y9dMgLqmp1yphWFa7IzESBUs2jhipcb6vWTuWRJtb QgUt34dkg+AUSkEVe/lPveYvobpICYkD5zsft1B3OAvl7DSmSrOAM+rc4kjp+Nw4diP2 S9rC9zUMLN0XoaPknUBBNodShi7hQzP7RXKeFNRw+5fkmag/bD6PrkFKBUabh4KxT3uh EaTHCMMXnOygiUj5B7ZtwLaGvTNyaEcXM6JaAa6PhOG15wjJMVW2fr3Fj5NCr/LVaOxD Yz3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vospIbfL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h10si12983747pfn.110.2022.01.24.14.13.00; Mon, 24 Jan 2022 14:13:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vospIbfL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380060AbiAXV6a (ORCPT + 99 others); Mon, 24 Jan 2022 16:58:30 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:39474 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378272AbiAXVQn (ORCPT ); Mon, 24 Jan 2022 16:16:43 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CD078614A7; Mon, 24 Jan 2022 21:16:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABCEDC340E5; Mon, 24 Jan 2022 21:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058997; bh=jYIRWSiUZSWF2+JFSFBxoVE0otIiJf+SdqOpEdwYg0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vospIbfL5jk6eh3JRrdndDCN7esFnZ6gX6/yQMsXK0WOn+fTd4/De/Cdlim6VNo6F hD+hzmZjWGgeLGFgU+PkEdqOOzE2JirlapKlbg+vFtEbslz2sCuVlXm5zJt1KNj82e YuAfQ4AdwisPR5weeY/A5YCoBB1FVBoqliLKBk60= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Andy Shevchenko , Sasha Levin Subject: [PATCH 5.16 0469/1039] misc: at25: Make driver OF independent again Date: Mon, 24 Jan 2022 19:37:38 +0100 Message-Id: <20220124184141.044529893@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ Upstream commit 5b557298d7d09cce04e0565a535fbca63661724a ] The commit f60e7074902a ("misc: at25: Make use of device property API") made a good job by enabling the driver for non-OF platforms, but the recent commit 604288bc6196 ("nvmem: eeprom: at25: fix type compiler warnings") brought that back. Restore greatness of the driver once again. Fixes: eab61fb1cc2e ("nvmem: eeprom: at25: fram discovery simplification") Fixes: fd307a4ad332 ("nvmem: prepare basics for FRAM support") Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125212729.86585-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/misc/eeprom/at25.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index b38978a3b3ffa..9193b812bc07e 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -17,8 +17,6 @@ #include #include #include -#include -#include #include /* @@ -380,13 +378,14 @@ static int at25_probe(struct spi_device *spi) int sr; u8 id[FM25_ID_LEN]; u8 sernum[FM25_SN_LEN]; + bool is_fram; int i; - const struct of_device_id *match; - bool is_fram = 0; - match = of_match_device(of_match_ptr(at25_of_match), &spi->dev); - if (match && !strcmp(match->compatible, "cypress,fm25")) - is_fram = 1; + err = device_property_match_string(&spi->dev, "compatible", "cypress,fm25"); + if (err >= 0) + is_fram = true; + else + is_fram = false; at25 = devm_kzalloc(&spi->dev, sizeof(struct at25_data), GFP_KERNEL); if (!at25) -- 2.34.1