From d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Mon, 11 Dec 2023 02:45:28 +0000 Subject: [PATCH] add boot partition size --- kernel/drivers/hsi/controllers/omap_ssi_port.c | 47 +++++++++++------------------------------------ 1 files changed, 11 insertions(+), 36 deletions(-) diff --git a/kernel/drivers/hsi/controllers/omap_ssi_port.c b/kernel/drivers/hsi/controllers/omap_ssi_port.c index 2ada82d..b9495b7 100644 --- a/kernel/drivers/hsi/controllers/omap_ssi_port.c +++ b/kernel/drivers/hsi/controllers/omap_ssi_port.c @@ -1,23 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* OMAP SSI port driver. * * Copyright (C) 2010 Nokia Corporation. All rights reserved. * Copyright (C) 2014 Sebastian Reichel <sre@kernel.org> * * Contact: Carlos Chinea <carlos.chinea@nokia.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA */ #include <linux/mod_devicetable.h> @@ -57,7 +44,7 @@ debugfs_remove_recursive(omap_port->dir); } -static int ssi_debug_port_show(struct seq_file *m, void *p __maybe_unused) +static int ssi_port_regs_show(struct seq_file *m, void *p __maybe_unused) { struct hsi_port *port = m->private; struct omap_ssi_port *omap_port = hsi_port_drvdata(port); @@ -132,17 +119,7 @@ return 0; } -static int ssi_port_regs_open(struct inode *inode, struct file *file) -{ - return single_open(file, ssi_debug_port_show, inode->i_private); -} - -static const struct file_operations ssi_port_regs_fops = { - .open = ssi_port_regs_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(ssi_port_regs); static int ssi_div_get(void *data, u64 *val) { @@ -172,7 +149,7 @@ return 0; } -DEFINE_SIMPLE_ATTRIBUTE(ssi_sst_div_fops, ssi_div_get, ssi_div_set, "%llu\n"); +DEFINE_DEBUGFS_ATTRIBUTE(ssi_sst_div_fops, ssi_div_get, ssi_div_set, "%llu\n"); static int ssi_debug_add_port(struct omap_ssi_port *omap_port, struct dentry *dir) @@ -187,8 +164,8 @@ dir = debugfs_create_dir("sst", dir); if (!dir) return -ENOMEM; - debugfs_create_file("divisor", S_IRUGO | S_IWUSR, dir, port, - &ssi_sst_div_fops); + debugfs_create_file_unsafe("divisor", 0644, dir, port, + &ssi_sst_div_fops); return 0; } @@ -253,10 +230,10 @@ if (msg->ttype == HSI_MSG_READ) { err = dma_map_sg(&ssi->device, msg->sgt.sgl, msg->sgt.nents, DMA_FROM_DEVICE); - if (err < 0) { + if (!err) { dev_dbg(&ssi->device, "DMA map SG failed !\n"); pm_runtime_put_autosuspend(omap_port->pdev); - return err; + return -EIO; } csdp = SSI_DST_BURST_4x32_BIT | SSI_DST_MEMORY_PORT | SSI_SRC_SINGLE_ACCESS0 | SSI_SRC_PERIPHERAL_PORT | @@ -270,10 +247,10 @@ } else { err = dma_map_sg(&ssi->device, msg->sgt.sgl, msg->sgt.nents, DMA_TO_DEVICE); - if (err < 0) { + if (!err) { dev_dbg(&ssi->device, "DMA map SG failed !\n"); pm_runtime_put_autosuspend(omap_port->pdev); - return err; + return -EIO; } csdp = SSI_SRC_BURST_4x32_BIT | SSI_SRC_MEMORY_PORT | SSI_DST_SINGLE_ACCESS0 | SSI_DST_PERIPHERAL_PORT | @@ -1061,10 +1038,8 @@ int err; err = platform_get_irq(pd, 0); - if (err < 0) { - dev_err(&port->device, "Port IRQ resource missing\n"); + if (err < 0) return err; - } omap_port->irq = err; err = devm_request_threaded_irq(&port->device, omap_port->irq, NULL, ssi_pio_thread, IRQF_ONESHOT, "SSI PORT", port); -- Gitblit v1.6.2